Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#2,201 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
react, typescript
Bereich
frontend

Rechercherichtung

Beginne mit der minimalen Reproduktion im StackBlitz-Projekt, insbesondere mit src/index.tsx, und vergleiche das Verhalten zwischen den betroffenen Versionen 1.32.0/1.33.0 und 1.31.0. Reproduziere den bedingten Ladezustand und überprüfe, dass das asynchron aufgelöste Array angezeigt wird, wenn form.Field gerendert wird, ohne dass eine zusätzliche Person hinzugefügt werden muss.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
TypeScript
Sterne
6.7k
Forks
695
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
12

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/form

Alle Issues in TanStack/form

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.