Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript issues after updating to 1.2.4 #1389

Closed
pulsedemon opened this issue Apr 7, 2025 · 6 comments
Closed

Typescript issues after updating to 1.2.4 #1389

pulsedemon opened this issue Apr 7, 2025 · 6 comments

Comments

@pulsedemon
Copy link

pulsedemon commented Apr 7, 2025

Everything is working fine, but eslint is now complaining about a lot of things. For example, the name attribute for form.Field:

Type 'string' is not assignable to type 'never'.ts(2322)
FieldApi.d.ts(131, 5): The expected type comes from property 'name' which is declared here on type 'IntrinsicAttributes & FieldComponentBoundProps<Record<string, never>, never, never, FieldValidateOrFn<Record<string, never>, never, never> | undefined, ... 15 more ..., {}>'
(property) FieldOptions<Record<string, never>, never, never, FieldValidateOrFn<Record<string, never>, never, never> | undefined, FieldValidateOrFn<Record<string, never>, never, never> | undefined, ... 4 more ..., FieldAsyncValidateOrFn<...> | undefined>.name: never
The field name. The type will be DeepKeys<TParentData> to ensure your name is a deep key of the parent dataset.

I'm currently on 1.2.2. Updated to 1.2.3 and no issues. The typescript changes in 1.2.4 should have been considered breaking changes.

@yanqiushi-mw
Copy link

Having the same problem in 1.3.0

@Balastrong
Copy link
Member

Could you please share more details to reproduce the issue? All type tests in the repo are passing and there are no errors in the examples.

Do you have a snippet to share? What typescript version are you using?

@pulsedemon
Copy link
Author

I'll try and put together an example. I'm using typescript 5.8.3. Looks like the same issue described here: #1391

@Balastrong
Copy link
Member

If you're using a discriminated union then yes, it might be the same issue.

I'm closing this as duplicate of #1391, if you have more details please share them on the other issue, if you think this is a different one I'll reopen it.

Thanks!

@pulsedemon
Copy link
Author

@Balastrong This is a different issue. I've put together an example to demonstrate.
https://codesandbox.io/p/devbox/affectionate-bardeen-p975cm

The form is defined in App.tsx and the ts error can be seen here.

@Balastrong
Copy link
Member

As written in #1391 (comment), that's not how the composition API works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants