Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/docs/08.1-more-about-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ Note that when the referenced component is unmounted and whenever the ref change

## The ref String Attribute

React also supports using a string (instead of a callback) as a ref prop on any component, although this approach is mostly legacy at this point.
> Note:
>
> Although string refs are not deprecated, they are considered legacy, and will likely be deprecated at some point in the future. Callback refs are preferred.

React also supports using a string (instead of a callback) as a ref prop on any component.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed: while I'm in here, should "ref prop" be changed to "ref attribute," since it's not really a prop?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally use the term prop to refer to anything that is passed into an element (eg. using jsx). I think it's probably fine as-is.


1. Assign a `ref` attribute to anything returned from `render` such as:

Expand Down