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
But of course this gives me some TS errors because it consider that errorMap is defined and that the ? and || are not needed. And it definitely feels more like a "hack-around"
As a user I expect that I can set the fieldMeta or directly when pushing the data with pushFieldValue or directly after with setFieldMeta.
This is important because the fields are populated by data from the user and it must be set a touched and dirty else other mechanism could override those values.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
OS: MacOS
Brave Browser
Version: 1.1.0
TanStack Form adapter
react-form
TanStack Form version
1.1.0
TypeScript version
5.7.0
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
I have an array field that can be populated dynamically based on some code.
I use the helpful
form.pushFieldValue
followed by aform.setFieldMeta
in order to tell the form that those fields are touched and dirty.Something like that:
When doing so, I have an runtime error when I submit my form :
After debuggin i realized that the updater of the
setFieldMeta
doesn't always have theerrorMap
property defined.I have found a workaround by doing something like that:
But of course this gives me some TS errors because it consider that
errorMap
is defined and that the?
and||
are not needed. And it definitely feels more like a "hack-around"Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-form-xuuktcwd?file=src%2Findex.tsx
Steps to reproduce
Expected behavior
As a user I expect that I can set the fieldMeta or directly when pushing the data with
pushFieldValue
or directly after withsetFieldMeta
.This is important because the fields are populated by data from the user and it must be set a touched and dirty else other mechanism could override those values.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
TanStack Form adapter
react-form
TanStack Form version
1.1.0
TypeScript version
5.7.0
Additional context
No response
The text was updated successfully, but these errors were encountered: