T
TanStack2mo ago
rising-crimson

Single or multiple useAppForm() per project?

This is something that isn't made very clear in the documentation, I think. From the name, I gather that it should be one hook used by all forms in the project. But some of the use-cases I've seen implies that you should create one useAppForm for each distinct form. So I figured I'd stop by and ask you experts which one it is!
5 Replies
rival-black
rival-black2mo ago
I am just using a single one.
sensitive-blue
sensitive-blue2mo ago
one per project. If you're worried about the amount of components, you can lazyload them.
fair-rose
fair-rose3w ago
Why is this better than having multiple?
sensitive-blue
sensitive-blue3w ago
because there‘s no point in the duplication. To be HMR compatible, the form context has been moved to module level, so there‘s also no context difference between the two
fair-rose
fair-rose3w ago
thanks!

Did you find this page helpful?