Skip to content

Async initial array values are not set #2178

Closed

Description

@eTallang

Describe the bug

Until version 1.31.0, it's been possible to set async initial values that are in the form of an array. In version 1.32.0, this does not seem to work anymore. I assume this PR is the reason, however I've not looked into it.

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-form-skfjtgfa?file=src%2Findex.tsx

Steps to reproduce

  1. Open the StackBlitz
  2. Notice that no person is displayed after 3 seconds, when the async state is updated
  3. You may click the "Add person"-button to notice that there suddenly is 2 persons in the list

Expected behavior

When the async state is resolved, I would expect the state to be updated in the form as well. This works up until version 1.31.0.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome

TanStack Form adapter

react-form

TanStack Form version

1.32.0

TypeScript version

6.0.3

Additional context

No response

Activity

  1. mudasirpandith commented on May 15, 2026

    @mudasirpandith

    @eTallang, is there a specific reason for maintaining separate state here instead of directly using form.setFieldValue?

    form.setFieldValue('people', [
            {
              age: 24,
              name: 'Ben',
            },
          ]);
  2. eTallang commented on May 15, 2026

    @eTallang
    Author

    @mudasirpandith I'm not sure I follow. The issue has to deal with asynchronous state, so I assume in your code example that form.setFieldValue would be called in a useEffect, which is not ideal. Not to mention, it should not be necessary since TanStack Form handles these cases automatically, according to the docs: https://tanstack.com/form/latest/docs/framework/react/guides/async-initial-values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions