You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constOneOfTemplateProps={widget: <Widget/* some props for widget*//>,content: option!==null&&<_SchemaField{...this.props}schema={optionSchema!}/>,// ...other props for OneOfTemplate}return<OneOfTemplate{... OneOfTemplateProps}/>
Then I can create the target UI by implementing a template without touching the complicated logic:
@YuJianghao You can provide, as part of your theme a custom AnyOfField and/or OneOfField that does what you want. See the docs
That said, I agree that having this new feature would be really helpful for theme builders like you. Are you willing to implement this first before completing your carbon theme?
Prerequisites
What theme are you using?
other
Is your feature request related to a problem? Please describe.
When building the Carbon theme (#3883), I met the following problem:
Suppose I want to implement the following oneOf UI:
oneOf
that told the user this is a oneOfloram
field) the oneOf is controlling.Without modifying the default
OneOfField
. I got:The problem is: How can I change the UI without rewriting the entire OneOfField?
Describe the solution you'd like
Provide a OneOfTemplate/AnyOfTemplate, and replace the render part of the OneOfField
react-jsonschema-form/packages/core/src/components/fields/MultiSchemaField.tsx
Lines 188 to 214 in 42e138c
to:
Then I can create the target UI by implementing a template without touching the complicated logic:
Describe alternatives you've considered
Rewrite the whole OneOfField can do this, but not good enough.
The text was updated successfully, but these errors were encountered: