Passing the form's type to a custom hook
I'm currently in the middle of refactoring from React Hook Form to TanStack Form, and I'm struggling to figure out how to pass the form's type to a custom hook. My goal is to abstract logic out of the component — things like inserting data into the form, setting errors, and so on.
I've gone through the form composition docs, but they don't seem to cover how to handle this kind of abstraction using custom hooks.
Am I missing something fundamental here?
Any insights would be greatly appreciated!
I've gone through the form composition docs, but they don't seem to cover how to handle this kind of abstraction using custom hooks.
Am I missing something fundamental here?
Any insights would be greatly appreciated!