reactjs / reactjs/react.dev

[Suggestion]: `forwardRef` is a legacy api, so should it be removed from where it's used?

Open
#7,350 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: documentation
Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

Summary

As above, in docs, there are still several references of forwardRef. It is suggested that we should remove them or replace them by a new way.

Page

No response

Details

I find out some pages(there may be more):

Accessing another component’s DOM nodes, the example in this section doesn't encounter error any more.

useImperativeHandle, there're a lot of forwardRef.

I can’t get a ref to a custom component, this doesn't encounter error neither.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the three linked documentation sections: “Accessing another component’s DOM nodes,” useImperativeHandle, and “I can’t get a ref to a custom component.” Review their current guidance and examples, then determine which forwardRef references are obsolete and what replacement guidance is intended. Done means the affected pages consistently reflect the agreed current API guidance and no outdated references remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.