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
Types in form work well, Field with name items.${number}.quantity works.
So, items in state are {} and when I change quantity for item with 64, it replaces items value with [null, null, null, ..., 64]
I also discovered, that if record keys are strings(contains any non-numeric character), it works fine.
Describe the bug
I've added Record field, so, type looks like this
Types in form work well, Field with name items.${number}.quantity works.
So, items in state are {} and when I change quantity for item with 64, it replaces items value with [null, null, null, ..., 64]
I also discovered, that if record keys are strings(contains any non-numeric character), it works fine.
Your minimal, reproducible example
https://codesandbox.io/p/devbox/zen-black-47s6fg?workspaceId=ca4463b1-f681-4a01-8bea-2aa832081a3a
Steps to reproduce
To reproduce a bug with number keys
To verify that it works with string keys
items: Record<string, { quantity?: number }>;
,<form.Field key={item} name={\
items.item-${item}.quantity`}>`Expected behavior
Even if I use numeric keys, it should work as record, not create array. Probably it could be recognised from array fields by existing of []
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
TanStack Form adapter
react-form
TanStack Form version
v34.0
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: