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 摘要。