How can we pass from object and it's type to child ?
i have to dynamiclly generate from based on user input so i need to pass
from object
currently i m doing
from:any
which works but reactive is not working
thanks please help me9 Replies
other-emerald•2mo ago
what is the structure of that dynamic form?
fuzzy-lavenderOP•2mo ago
other-emerald•2mo ago
so you have a big form that has
productsVariantsSchema
as its structure.
You want to split off parts of the form (the variant) and generate it once per item in the array.
The way to do that would be using withForm
in Form Composition
You would have a structure like:
fuzzy-lavenderOP•2mo ago
oh so this is the way i will try this and let you know
it would be better if this in doc
fuzzy-lavenderOP•2mo ago
oh got it
https://tanstack.com/form/latest/docs/framework/react/guides/form-composition#breaking-big-forms-into-smaller-pieces
this is i need to follow
thanks
Form Composition | TanStack Form React Docs
A common criticism of TanStack Form is its verbosity out-of-the-box. While this can be useful for educational purposes helping enforce understanding our APIs it's not ideal in production use cases. As...
other-emerald•2mo ago
also,
as const
is important for the namespace. See this as example
fuzzy-lavenderOP•2mo ago
okay let me try this
can we pass
sharedFormOptions(isEdit)
as i m doing same form for edit and create
and pass default valuesother-emerald•2mo ago
withForm
expects exactly the same form
grouping fields for multiple forms is not implemented yet. There is a PR ready, but it is not released yetfuzzy-lavenderOP•2mo ago
oh okay thanks
i will check this later becouse now react-hook-from does the job for now