v.45.1 and type errors
I'm trying to update from 42.1 and it's blowing up with new requirements
Generic type 'ReactFormExtendedApi' requires 10 type argument(s).
Where I've been passing just 1 argument without problem.
and
<Field> requires 19 type arguments, where I've been passing 2.
Surely not....


5 Replies
deep-jade•7mo ago
Yes, actually. However, for 1.0 it will be accompanied by a new API
useAppForm
and withForm
so you can create your own reusable form components without needing to do any of that typing.
See this PR for more details https://github.com/TanStack/form/pull/1179fair-roseOP•7mo ago
wow really, for all my 100 fields I need to enter in 19 types? 😟
deep-jade•7mo ago
after the PR is merged, you wouldn't need to enter any types at all
just restructure the reused components around the new fieldComponents
fair-roseOP•7mo ago
I don't know what that would look like, but sounds like we will hold off on the update and await updated documentation.
optimistic-gold•7mo ago
The PR includes an example of how to do what you're doing here. You can even use that PR in your app today if you'd like.
Wrote about why this change here:
https://github.com/TanStack/form/issues/1175#issuecomment-2681732028
GitHub
bug:
useForm
and FormApi
require 9 generic types instead of 1 s...Describe the bug Previously with v0.42.x the types of useForm (react hook) and FormApi (core class) had 2 generic types, with only 1 being required: TFormData, TFormValidator extends Validator<T...