A common use case that I have is that the fields I have in my form will differ based on one of the inputs. The difference from the <FieldArray /> usecase and this is that I do not know before hand what components are being added. I.e., I'm rendering a completely different set of components based on the value selected by the user.
It is possible to build such forms using Formik, but it's not clear how to.
Here are some example issues that showcase the things you need to collect together to build such a form:-
📖 Documentation
A common use case that I have is that the fields I have in my form will differ based on one of the inputs. The difference from the
<FieldArray />
usecase and this is that I do not know before hand what components are being added. I.e., I'm rendering a completely different set of components based on the value selected by the user.It is possible to build such forms using Formik, but it's not clear how to.
Here are some example issues that showcase the things you need to collect together to build such a form:-
These are certain things that if documented I think could help:-
setFieldTouched
andsetFieldValue
validationSchema
orvalidate
at the field levelname
propinitalValues
/ Best practices on setting initial value at field levelI think adding documentation under the Guides section would be helpful!
I'd love to help add this if it makes sense.