Docs update request: Forwarding multiple refs
未关闭
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 11.8k
- 派生
- 7.9k
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 11
描述
Hello!
I have found a variety of resources on the web describing ways to forward multiple refs to a child component so they can be accessed by a parent component:
- https://dev.to/oussel/a-guide-for-refs-in-react-45l6#chapter-5
- https://stackoverflow.com/a/53818443/4558300
- https://thewebdev.info/2021/11/14/how-to-forward-multiple-refs-with-react/
- https://medium.com/swlh/refs-and-forward-refs-in-react-be5bcb86fc69
Would it be possible to add a section to the official docs which describes what is going on in these examples? I think that these examples use the behavior of useRef as described in the useRef docs, but I'm honestly not sure. I think an official example of this would be very helpful.
Thanks!
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,将链接的示例与 issue 中引用的 React useRef 文档进行比较。确定官方 Docs 如何组织 ref 指南,然后添加一个解释转发多个 ref 的章节和示例;完成的标准是,在适当的 React Docs 中清晰记录该行为和示例。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100