Conflicting description on getSnapshotBeforeUpdate section on the React.Component page
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 11.8k
- 派生
- 7.9k
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 11
描述
Page: https://reactjs.org/docs/react-component.html
Section: getSnapshotBeforeUpdate
The description after the code block reads
In the above examples, it is important to read the scrollHeight property in getSnapshotBeforeUpdate because there may be delays between “render” phase lifecycles (like render) and “commit” phase lifecycles (like getSnapshotBeforeUpdate and componentDidUpdate).
It is indicating that we should be reading the scrollHeight property in getSnapshotBeforeUpdate due to the delays between the "render" phase lifecycles and "commit" phases lifecycles. But getSnapshotBeforeUpdate is indicated as one of the "commit" phases lifecycle. Is that correct?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
阅读 https://reactjs.org/docs/react-component.html 上 React.Component 页面中的 getSnapshotBeforeUpdate 部分,包括代码块及其下方带引号的说明。检查该描述是否正确区分了 render 阶段和 commit 阶段的生命周期,然后更新存在冲突的措辞,使生命周期时机明确无歧义。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100