react-jsonschema-form
react-jsonschema-form copied to clipboard
Array Length dependant on FormContext Value
Prerequisites
- [X] I have read the documentation
What theme are you using?
core
What is your question?
I am using rjsf to insert a sub-form into a much larger form that has fixed questions. I need to be able to control the amount of items inside a custom array field from the outside using formContext.
For context, I am using it as an intake form for a booking system. We allow multiple people to book at once, so I was going to use the array fields to allow employees to make questions that are duplicated for every guest. The array should still have an option to add/remove guests, but it should modify the formContext value so the changes are applied globally and the value can be validated externally.
I tried wrapping the ArrayField field with my own field and setting its minItems and maxItems from the wrapper element, but it did not seem to populate automatically. Would I need to make my own array element?
@selfesteemteam I don't know how to answer your question as I don't have enough context