Async initial array values are not set when form.Field is conditionally rendered
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
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
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.7k
- Forks
- 695
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/form
-
`isDefaultValue` is wrong when a field-level `defaultValue` is `null`Evtl. vergeben @fenet-as hat das vor 6 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
TanStack/form#2427 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Async validator doesn't re-trigger `isValidating` after first failed validationEvtl. vergeben @drewsephski hat das vor 10 Tagen übernommen. Offen
Schwierigkeit 2/5 1-2 Tage Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
[v2 alpha] devtools are always light modeEvtl. vergeben @dikshit-n hat das vor 44 Tagen übernommen. Offenarea: runtime scope: devtools type: bug v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
FormGroupApi.getRelatedFields and FieldApi.validate() use unguarded startsWith for group membership, matching unrelated fields with a shared name prefixEvtl. vergeben @HDPark95 hat das vor 63 Tagen übernommen. Offenarea: runtime scope: core type: bug v1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
TanStack/form#2337 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
FormApi: onSubmit/onServer error cleared on any non-matching validation cause, not just 'change'Evtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenv1 v2: needs investigation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
paperclipai/paperclip#16785 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
code-yeongyu/senpi#3661 ·
Maintainer antworten meist innerhalb von 1 Tag
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
lingdojo/kana-dojo#32731 · 1 Kommentar · 5 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug status: needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
mastra-ai/mastra#27538 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Yeachan-Heo/oh-my-codex#3822 ·
Maintainer antworten meist innerhalb von 1 Tag