You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to understand the correct way to type a useAppForm instance when it is passed down to child components. The current documentation only shows flat examples where the form is created and used within the same component, but this does not reflect real-world usage where forms are split across multiple components.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to understand the correct way to type a
useAppForminstance when it is passed down to child components. The current documentation only shows flat examples where the form is created and used within the same component, but this does not reflect real-world usage where forms are split across multiple components.When I pass the form instance like this:
TypeScript loses all field information:
– field names do not autocomplete
–
field.state.valuebecomes{}– value-related components report type errors
What is the recommended way to correctly type the
formobject when it is passed as a prop so that all field names and value types are preserved?Clear guidance in the documentation would be very helpful, as most real applications do not use a single flat component structure.
Minimal example:
Beta Was this translation helpful? Give feedback.
All reactions