Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Async initial array values are not set when form.Field is conditionally rendered

Aberta
#2,201 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
48/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
react, typescript
Domínio
frontend

Direção de pesquisa

Comece com a reprodução mínima no projeto StackBlitz, especialmente em src/index.tsx, e compare o comportamento entre as versões afetadas 1.32.0/1.33.0 e 1.31.0. Reproduza o estado de carregamento condicional e verifique se o array resolvido de forma assíncrona aparece quando form.Field é renderizado, sem exigir que outra pessoa seja adicionada.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

v1 v2: needs investigation
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, where the form.Field that displays the array is conditionally rendered. In version 1.33.0, this does not seem to work anymore (it was broken from version 1.32.0). This bug is pretty similar to the issue I reported a couple of weeks ago, where the difference is that I now conditionally render the form.Field that displays the array. The use case for this, is showing a loading UI while the async data is fetched. It was concluded in my previous issue that it was a regression from https://github.com/TanStack/form/pull/2172, so I assume the same goes for this new issue.

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-form-ehnyffpx?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 and the loading UI disappears
  3. You may click the "Add person"-button to notice that there suddenly is 2 people in the list
Expected behavior

I would expect the form.Field to render the array when the async data is resolved and the form.Field is displayed.

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.33.0 (from 1.32.0)

TypeScript version

6.0.3

Additional context

No response

Linguagem predominante
TypeScript
Estrelas
6.7k
Forks
699
Merge médio
1d 7h
PRs com merge (30d)
12

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TanStack/form

Todas as issues de TanStack/form

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.