react-jsonschema-form
react-jsonschema-form copied to clipboard
setting options via ui:widget object is no longer supported, use ui:options instead
Prerequisites
- [X] I have read the documentation
What theme are you using?
other
What is your question?
It seems I have an issue with the migration from ui:widget
to ui:options
. How can this be migrated? I have looked into the migration guide but could not find any information. I get this error:
setting options via ui:widget object is no longer supported, use ui:options instead
I have several locations where I use "hidden" with the ui:widget
like this:
let orderModalUISchema = {
orderId: {"ui:widget": 'hidden'},
status: {"ui:widget": 'hidden'},
};
I also use the widget for custom components like this which seem to be responsible for the issue:
"ui:widget": connect(mapStateToProps)((props) => {
const onChangeSubscriberId = (event) => {
props.onChange(event.target.value);
};
return (
<select disabled={disabled} onChange={onChangeSubscriberId} value={props.value} id="root_subscriberId"
className='form-control' required>
<option key="empty" value=""></option>
{props.subscribers.map(subscriber => (
<option key={subscriber.id} value={subscriber.id}>
{subscriber.id}____{subscriber.name}
</option>
))}
</select>
);
}),
Interesting is, when I wrap this with a withRouter
the error is not happening.
I'm using Bootstrap 3.