[Bug]: Resetting Suspense boundaries on navigation not work
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 11.8k
- 派生
- 7.9k
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 11
描述
Summary
Resetting Suspense boundaries on navigation not work
Page
https://react.dev/reference/react/Suspense
Details
I come up with an example as the documentation says:
However, now imagine you’re navigating between two different user profiles. In that case, it makes sense to show the fallback. For example, one user’s timeline is different content from another user’s timeline. By specifying a key, you ensure that React treats different users’ profiles as different components, and resets the Suspense boundaries during navigation. Suspense-integrated routers should do this automatically.
https://codesandbox.io/p/sandbox/react-dev-forked-4fszvr?file=%2Fsrc%2FApp.js
However, key do not work as expect, i.e. I did not see a loading indicator
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 Suspense 参考页面开始,并在 src/App.js 中运行其中链接的 CodeSandbox 复现。将观察到的导航行为与页面关于 key 会重置 Suspense 边界的表述进行比较,然后确定需要修正的是示例还是文档。复现出所报告的差异,并且页面或示例准确反映该行为,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react
- 领域
- documentation, frontend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100