Async initial array values are not set when form.Field is conditionally rendered
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
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
- Open the StackBlitz
- Notice that no person is displayed after 3 seconds, when the async state is updated and the loading UI disappears
- 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
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/form
-
`isDefaultValue` is wrong when a field-level `defaultValue` is `null`Talvez já em andamento @fenet-as assumiu há 13 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
TanStack/form#2427 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Async validator doesn't re-trigger `isValidating` after first failed validationTalvez já em andamento @drewsephski assumiu há 17 dias. Aberta
Dificuldade 2/5 1-2 dias Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
[v2 alpha] devtools are always light modeTalvez já em andamento @dikshit-n assumiu há 51 dias. Abertaarea: runtime scope: devtools type: bug v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
FormGroupApi.getRelatedFields and FieldApi.validate() use unguarded startsWith for group membership, matching unrelated fields with a shared name prefixTalvez já em andamento @HDPark95 assumiu há 70 dias. Abertaarea: runtime scope: core type: bug v1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
TanStack/form#2337 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
FormApi: onSubmit/onServer error cleared on any non-matching validation cause, not just 'change'Talvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Abertav1 v2: needs investigation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
Todas as issues de TanStack/form
Issues semelhantes
-
freshness freshness:observed-only
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
thoroc/context-radar#282 ·
-
bug P2 rust
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
area: web
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
gabe-santana/arkdraw#25 ·
-
bug require-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
expressjs/expressjs.com#2549 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
bug good first issue hacktoberfest
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
codercops/discord-bot#101 · 1 comentário ·
Mantenedores costumam responder em até 1 dia