Why don't we mention the concept of callBack props in the 'Lifting State Up' page?
未关闭
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 11.8k
- 派生
- 7.9k
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 11
描述
There are times the source of the detailed or complete data is best isolated in a child component rather than trying to lift the state up and creating large parent component. The large parent component that has all the state, goes against the concepts of code isolation and separation of concerns,
Given this, why not add a note to https://reactjs.org/docs/lifting-state-up.html that talks about callback props?
There are 3 issues i'm aware of with callback props:
- that warning that the parent component is still rendering: solution: launch the event handler code asynchronously
2): In async functions, after await(), we should check whether the component is still mounted.
3): whenever a function is passed as a prop it must be frozen and then only added to the useEffect() dependency chain (better to add all dependencies for useEffect rather than ignore the warning)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 reactjs.org/docs/lifting-state-up.html 的“Lifting State Up”页面开始,检查 callback props 与其中指导内容的关系。评估 issue 中列出的三个问题,并确定页面是否应加入准确的说明。完成的标准是:文档包含清晰且有技术依据的解释,或者有理由地拒绝 issue 中提出的添加内容。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100