TanStack

T

TanStack

TanStack is a community of passionate software engineers striving for high-quality, open-source software for web devs

Join

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

flat-fuchsia
flat-fuchsia3/15/2025

use external values for form state values

I have a form; values in inputs can be specified by the user manually, but I would like to have as well an ability to pass value from, for example, Zustand. Is that possible? Thank you for any help.
genetic-orange
genetic-orange3/15/2025

Replace field value over validates other fields?

When using replaceFieldValue, it seems we hardcoded always validating all array elements after the element that was replaced? I don't see any logical reason to do this, it ends up blowing up the amount of errors shown to the user when they didn't touch or do anything to the additional fields? See: https://stackblitz.com/edit/vitejs-vite-bftecz1f?file=src%2Fcomponents%2FForm.tsx ...
conscious-sapphire
conscious-sapphire3/14/2025

FieldMeta Generic required type arguments

Hi there! I know some of the generics were recently updated in a PR. I'm trying to use FieldMeta and now getting a required type args error for 17 req'd types. Egad! hahah Is there another generic that should be used? Basically trying to abstract an info component for displaying meta info. Thanks!...
No description
stormy-gold
stormy-gold3/13/2025

Manage Active field & error handling

Hello, quick question, how can i manage the error appearing only if the user making the field not active anymore ? is there a builtin functionnaly to manage that or i have to make it work by myself ? thanks 🙂
foreign-sapphire
foreign-sapphire3/13/2025

subField properties are type unknown

Hi! I am receiving type unknown on all properties in a subField using the array method in the Vue Example: Type in the v-for is correct:...
No description
graceful-beige
graceful-beige3/13/2025

API of Pre-bound Field Components

Could you instead of ```tsx <form.AppField name="fullName" children={(field) => ...
genetic-orange
genetic-orange3/13/2025

Are validators not supposed to be defined inside of formOptions?

when using the formOptions I notice type inference doesn't flow into the validators. However if we ONLY define the default options within formOptions and we define the validators within useAppForm, the inference works. Is the recommendation to define them there?...
No description
wise-white
wise-white3/12/2025

createFormHook Usage

Is createFormHook meant to be used as a global hook for multiple forms? I don't quite understand how to scale the Form Composition example. Should I create a single hook with all possible form and field components used in the app even if some forms don't use all of the form/field components?...
correct-apricot
correct-apricot3/12/2025

False Positive Error on Field[`name`]

When using mode="array" and iterating over each item, the name field must be a nested item of the array field and cannot simply be the array item's index. (https://github.com/nickhudkins/reimagined-umbrella/blob/main/src/main.tsx#L92). This is somewhat related to type safe SubForms, and the overall form composition story, so it's possible that casting this as any is fine for now and we'll figure out a better API later?
xenial-black
xenial-black3/11/2025

Any way to configure default validators for fieldComponents defined in createFormHook?

I have some composite fields that should have the same basic validation no matter what form they're added to. This is just a simple check to make sure each sub-field is populated. Writing and sharing the validation with a util is relatively easy, but it would be cool if I could set the validators once instead of on each form definition. Is this possible?
No description
fair-rose
fair-rose3/11/2025

Updating a specific form value in an array field?

Hi! I have an array of fields (let's call them "people") and for each person I have an autocomplete that the user can use to select the person's location. There's a mutation that's called whenever the form field updates, which then displays a list of suggestions, but I'm not sure what the recommended approach is to having the suggestion selection set the location for the current person. What would y'all suggest for this?
adverse-sapphire
adverse-sapphire3/11/2025

How to set submit as disabled until form completed?

I have a basic form. 2 fields. Right now I'm doing the following to set the submit as disabled on page load. ```...
No description
wise-white
wise-white3/11/2025

Is there a way to create subforms?

I would love a way to create a group of fields that always look the same, but I can nest them under a object or similar and reuse the same component This doesn't work and I cannot find a way to do this right now. Is this already possible? I would love a way to do this with type safety, as I find this comes up quite often. A way to add a prefix or a subform would solve this really well I think...
unwilling-turquoise
unwilling-turquoise3/10/2025

Using isTouched to show error messages fails with schema

Some confusion with the current handling of isTouched brought me here. I'm using this meta property to surface the error message for the user at the right time. I've adapted the example to show the issue I see: https://stackblitz.com/edit/vitejs-vite-offm7dia?file=src%2FApp.jsx 1. Touch the first optional input (click and blur). Notice the error messages get set for all fields (correct for the onBlur schema). isTouched is correctly set to true for the first field and hence the relevant error message is visible....
adverse-sapphire
adverse-sapphire3/10/2025

Submit form not working

I'm creating my own package for the form. index.tsx ``` import { createFormHook } from '@tanstack/react-form'...
foreign-sapphire
foreign-sapphire3/9/2025

Remix integration

Hi, trying out the new Form library with a React Router (Remix) app. Feels really good, but I'm struggling to get errors from the server into the formfields. The example also has server validation, but the errors are returned in the global formErrorsMap instead of the errors of the fields. Anyone knows if I'm missing something or if it is not possible to return them in the fields? Made a small fork from the example using zod: https://stackblitz.com/edit/tanstack-form-5jswndpa?file=app%2Froutes%2...
correct-apricot
correct-apricot3/7/2025

Spread properties over an input field

I am used to react hook form, and there you can connect an input by doing {...register('fieldName')}. Now the architecture is different on TSF, but is the a possibility to do something like: ```typescript <form.Field name="firstName" children={(field) => {...
metropolitan-bronze
metropolitan-bronze3/7/2025

Type errors when adding a validator zod schema and initializing the default value to null.

I have a schema where the field month is validated to be non null.
const schema = z.object({ month: z.coerce.date()})
const schema = z.object({ month: z.coerce.date()})
...