react-query-questions
solid-query-questions
table-questions
virtual-questions
router-questions
react-charts-questions
ranger-questions
vue-query-questions
svelte-query-questions
bling-questions
form-questions
angular-query-questions
start-questions
db-questions
start-showcase
router-showcase
📣-announcements
v.45.1 and type errors

Getting all errors from field AND subfield
<form>#getFieldMeta()
on all subpaths, or get all errors and reduce them based on my parent field's name.
Is there an easier way?
Example of my implementation:...should blur trigger onChange validation?
onChange
validation errors when clicking into and then out of a field (but without changing the value). Looking at the code it seems like if a field was never previously touched, then blurring the field causes the "change" validation to run. Does this seem accurate? Did I miss something in the docs re: this behavior?
https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1602...field.state.meta.errors type is undefined[] when using Form level schema only?
Can't use Zod/Yup schema for form level validator?
Is this a bug with removeValue on nested array elements?
Equivalent to setError?
react-hook-form
now, and my foel has recaptcha. I am keeping track of recaptcha in the form state, like any other input. I was using setValue()
to set the value in the form state after the widget has been clicked and setError()
when the server was returning an error related to recatpcha. Using TanStack Form, I replaced setValue()
with setFieldValue()
but I do not know how to replace setError()
. Any tips? tahnk you 🙂"has been changed since submission" state?
Conditional fields and validation?
visible
is false, lastName
should not validate here....Different validation strategy when there is an error
onBlur
by default but when there's an error in a field, revalidate that field using onChange
? RHF has a onTouched
mode for validation that take care of thiscreating a form context and using useField from that context
0.33.0
i did something link this
FormContext createContext<ReactFormApi<[type inferred from zod schema
]>
...Globally logging user interactions
Any advantage to setting defaultValues instead of setFieldValue?
how to disable field based async validation if value === defaultValue
Reset field meta data
Visible fields are always isTouched
How to sync with external store like Zustand?
persist()
middleware.
My current solution utilizes the internal Store api to subscribe to store changes. I then update the Zustand store with new store values as they come. In the following snippet, you'll see that I have tried subscribing in two ways. Directly calling subscribe outside of a useEffect causes nearly 100 store updates. The current approach only updates the store 5 times, and this may be acceptable since this causes no rendering issues (the store values are only grabbed at component mount). Here is my current solution:
```TypeScript...Custom Meta value for field?
Get index of pushed value in field array
pushValue()
method. For context, I have an add/edit modal that renders an item in the modal that I am either adding or editing, and that is determined by the index in the array. This is fine with selecting an item to edit because the index was already defined, but when adding I would have to do something like `setSelectedIndex(form.state.values.items?.length...