You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a typescript typing bug that was not present in 0.42.0 (I'm unaware of when it was introduced as I just upgraded to v1 from that version).
It causes some subfields's type to be "unknown". To encounter it you must have a structure that causes the field name to be something like this: prop1.array[${idx].prop
Describe the bug
This is a typescript typing bug that was not present in 0.42.0 (I'm unaware of when it was introduced as I just upgraded to v1 from that version).
It causes some subfields's type to be "unknown". To encounter it you must have a structure that causes the field name to be something like this:
prop1.array[${idx].prop
This does only seem to happen when the array and/or parent object in the zod schema is set to optional. But there are some reports of user's having a similar issue even when the parent array or object are not optional (https://discord.com/channels/719702312431386674/1100436934205124660/threads/1349742197788119052)
edit: some other users are saying that the issue happens when using null or optional on arrays
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-form-uqugutkr?file=package.json,src%2Ffeatures%2Fpeople%2Fshared-form.tsx,src%2Ffeatures%2Fpeople%2Fpage.tsx&preset=node
Steps to reproduce
invoice.items[${0}].isPhysical
Expected behavior
I expect the type in the field.state.value to be correct
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
TanStack Form adapter
None
TanStack Form version
v1.1.0
TypeScript version
unsure
Additional context
No response
The text was updated successfully, but these errors were encountered: