Documentation suggests using withForm
if you want to be able to "reuse whole subsections of your form" - is this wrong?
#1309
Replies: 2 comments 5 replies
-
Can I ask again for an answer to this? The docs clearly state that you should be able to reuse whole subsections of your form but that doesn’t seem to be the case, unless I’m missing something, as |
Beta Was this translation helpful? Give feedback.
-
Good to know, thanks!
I will give this a go soon - I am not sure it will work for my use case, which is a fairly complex array of fields which can in some cases themselves contain arrays of fields, but it might? This would basically be creating a composite field, if I understand correctly? |
Beta Was this translation helpful? Give feedback.
-
The form composition docs page includes an "API Usage Guidance" tree which suggests that you should use
withForm
if you need to "reuse whole subsections of your form".I may have misunderstood, but from what I've read it seems that
withForm
is not intended to be / capable of being used in this way, specifically to make reusable subsections. As theformOptions
have to be identical for the parent and child forms, components created withwithForm
are not reusable - they can only be used in the specific parent form with the matching formOptions. Is this correct?So
withForm
allows you to break a big form down into smaller components that can be composed together, but those components cannot be reused across multiple forms.If this is correct then maybe the tree diagram should be updated with different wording? If this isn't correct (which would be great as I really need this!) then an example of how to do it in the docs would be really helpful.
Beta Was this translation helpful? Give feedback.
All reactions