rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.

Home Page:https://rjsf-team.github.io/react-jsonschema-form/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support for array of objects with various dynamic schemas

asifmom opened this issue · comments

Prerequisites

  • I have read the documentation;
  • [ x] In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.

Description

Check the jsfiddle https://jsfiddle.net/asifmomin/xtbyky32/

One of the items of the top level schema is a field component which is an array. It has a select field called Type, which has values M1, M2, M3 etc..
If the user has selected M1, then another dynamic field should be shown after Type field
If the user has selected M2, another subcomponent array would be show and so on..

I guess there are two approaches to solve this issue:

  1. support of anyof
  2. Somehow dynamically updated the schema on change event. I guess I can use additionalItems here. But in OnChange handler, you don't get to know the field due to which the onchange handler is called.

How would solve the edit from the formdata?

This is a duplicate of #52.