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