Re-usable forms #13147
Unanswered
UltraWelfare
asked this question in
Q&A
Re-usable forms
#13147
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My use-case is as following;
I have a rather complex "Create a Project" form. Some fields are dynamically generated from API queries, the validation schema is also dynamically generated.
This form exists in an authenticated route (
/projects/create) but should also exist in the registration form... From the landing page you can click "Create a project" and in the case of not having an account, you can create a project and register at the same time.. Then all the data is being submitted at once.I don't wanna copy-paste the whole create a project form into the registration page...
One way I thought of is to have two different
useForms in the parent component; one for the project creation and once again for the registration. This is kinda "messy" and feels like a huge workaround but could work I guess?Ideally what I was thinking was something like:
But this would completely destroy type-safety... Are there any good ideas on how to handle that?
Beta Was this translation helpful? Give feedback.
All reactions