No API docs on React Refresh
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 11.8k
- 派生
- 7.9k
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 11
描述
I was experiencing how useEffect was re-running with empty dependencies due to HMR (which was expected) on changes, but I saw how re-running did not trigger the useEffect cleanup function. This was unexpected and maybe a bug? I thought I would reference the HMR / Fast Refresh docs to verify the expected behaviour before reporting, but I could not find anything (apart from reactnative.dev) on any React owned sites! All docs/articles I could find were on third party sites.
AFAIK, Fast Refresh is the native (as in built-in) React solution to HMR, so it is part of React. That means it has an API exposed to end users, and I would then expect it to be documented. Searching "HMR" or "Fast Refresh" comes up with nothing when using the docs search feature.
I can only find "implicit docs" on Fast Refresh on the issue tracker (such as these by Dan: https://github.com/facebook/react/issues/21019) or on external articles and none mention how the cleanup callback is supposed to work in Fast Refresh mode.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先查看 reactnative.dev 上现有的 Fast Refresh 资料、React 文档中搜索“HMR”和“Fast Refresh”的结果,以及链接的 issue #21019。确定 cleanup-callback 的预期行为,并在 React 维护的文档页面上记录 Fast Refresh 的公开行为和 API 概念。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100