Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#2,201 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu với bản tái hiện tối thiểu trong dự án StackBlitz, đặc biệt là src/index.tsx, và so sánh hành vi giữa các phiên bản bị ảnh hưởng 1.32.0/1.33.0 và 1.31.0. Tái hiện trạng thái tải có điều kiện và xác minh rằng mảng được phân giải bất đồng bộ xuất hiện khi form.Field được render, mà không cần thêm một người khác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
6.7k
Fork
691
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TanStack/form

Tất cả issue của TanStack/form

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.