Repository navigation
How to pass useForm type to reusable component properly ? #1917
Replies: 1 comment
|
The issues you are running into come down to two reasons in TypeScript's type inference system:
Here are the two idiomatic ways to solve this in Approach 1 (Recommended): Decouple Form Logic from UI PresentationIn TanStack Form, the cleanest and most modular pattern is to let 1. Define the reusable
|
Uh oh!
There was an error while loading. Please reload this page.
since I am using
anytype for InputField props, i am gettingTS7031: Binding element state, handleChange, handleBlur implicitly has an any type.type error... in my case, how I properly set types here ? you can check full code in github gist (below link).I have tried
type Form = ReturnType but it is solving current issue but causing more type errors in my form
Full code: https://gist.github.com/abdulazizkhatamov/e7c6fbbecf92c3acf54a7744c3b17f3d

Image:
All reactions