T
TanStack6mo ago
optimistic-gold

createFormHook Usage

Is createFormHook meant to be used as a global hook for multiple forms? I don't quite understand how to scale the Form Composition example. Should I create a single hook with all possible form and field components used in the app even if some forms don't use all of the form/field components?
3 Replies
optimistic-gold
optimistic-goldOP6mo ago
Edit: My use case is creating a UI component and form library to use in multiple projects. Would I just use lazy imports for each of the field/form components I plan to use?
optimistic-gold
optimistic-gold6mo ago
Yes, createFormHook is intended to be made once for a whole codebase With React.lazy providing lazy loading if needed
optimistic-gold
optimistic-goldOP6mo ago
Thank you

Did you find this page helpful?