housekeeping: prevent log warning for missing getComponent in production
This is a force-pushed squash of two PR merges (#5919, #5940) that were formerly present on master as individual commits. Co-Authored-By: kyle shockey <kyleshockey@gmail.com>
This commit is contained in:
committed by
Kyle Shockey
parent
12e86dafb0
commit
0426eb2344
@@ -50,8 +50,15 @@ export class JsonSchemaForm extends Component {
|
||||
schema = schema.toJS()
|
||||
|
||||
let { type, format="" } = schema
|
||||
// In the json schema rendering code, we optimistically query our system for a number of components.
|
||||
// If the component doesn't exist, we optionally suppress these warnings.
|
||||
let getComponentSilently = (name) => getComponent(name, false, { failSilently: true })
|
||||
|
||||
let Comp = (format ?
|
||||
getComponentSilently(`JsonSchema_${type}_${format}`) :
|
||||
getComponentSilently(`JsonSchema_${type}`)) ||
|
||||
getComponentSilently("JsonSchema_string")
|
||||
|
||||
let Comp = (format ? getComponent(`JsonSchema_${type}_${format}`) : getComponent(`JsonSchema_${type}`)) || getComponent("JsonSchema_string")
|
||||
return <Comp { ...this.props } errors={errors} fn={fn} getComponent={getComponent} value={value} onChange={onChange} schema={schema} disabled={disabled}/>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user