reactjs / reactjs/react.dev

Using revealOrder="backwards" in SuspenseList only works for very short wait times

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

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

Ngôn ngữ chính
JavaScript
Star
11.8k
Fork
7.9k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
11

Mô tả

I realize that this is still experimental, but I figured it would still be good to report bugs. If not, feel free to close this issue.

I was playing around with the examples in https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist and noticed that revealOrder="backwards" didn't seem to work. The trivia items never appear before the posts. After fiddling around with the example in https://codesandbox.io/s/black-wind-byilt i noticed that it works if the timeout is set around 500 ms or below for the trivia items. But if you set it to for example 1000 ms, it will instead wait until both trivia and posts are available.

revealOrder="forwards" seems to work regardless of how long the timeout is.

I tried changing React version to the latest experimental version (0.0.0-experimental-c76e4dbbc-20210722), but it did not seem to make a difference.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Tái hiện ví dụ SuspenseList trong tài liệu React và CodeSandbox được liên kết, so sánh revealOrder="backwards" với độ trễ trivia 500 ms và 1000 ms. Trước tiên, hãy kiểm tra phiên bản React experimental được báo cáo và hành vi timeout của ví dụ; được xem là hoàn tất khi đã xác định nguyên nhân và hành vi thứ tự backwards trong thời gian chờ lâu hơn được sửa hoặc được xử lý rõ ràng.

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

Đánh giá

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

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.