Skip to content

Commit

Permalink
Merge pull request #5940 from tim-lai/master
Browse files Browse the repository at this point in the history
housekeeping: prevent log warning for missing getComponent in production #5919
  • Loading branch information
tim-lai authored Apr 1, 2020
2 parents 4b81aea + 1d4125a commit 5ef1a15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/json-schema-components.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export class JsonSchemaForm extends Component {
// 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 ?
getComponentSilently(`JsonSchema_${type}_${format}`) :
getComponentSilently(`JsonSchema_${type}`)) ||
getComponentSilently("JsonSchema_string")

return <Comp { ...this.props } errors={errors} fn={fn} getComponent={getComponent} value={value} onChange={onChange} schema={schema} disabled={disabled}/>
}

Expand Down

0 comments on commit 5ef1a15

Please sign in to comment.