reactjs / reactjs/react.dev

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

未關閉
#3,812 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
11.8k
分支
7.9k
平均合併
1 天 11 小時
30 天內合併 PR
11

描述

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.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

重現 React 文件和連結的 CodeSandbox 中的 SuspenseList 範例,比較 revealOrder="backwards" 在 500 ms 和 1000 ms trivia 延遲下的表現。首先檢查回報的 experimental React 版本以及範例的 timeout 行為;完成的標準是找出原因,並修正或明確處理較長等待時間下的 backwards 順序行為。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, react
領域
frontend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。