Docs update request: Forwarding multiple refs
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
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!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the linked examples with the React useRef documentation referenced in the issue. Determine how the official docs organize ref guidance, then add a section and example explaining forwarding multiple refs; done means the behavior and example are clearly documented in the appropriate React docs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100