From b5172001e1f23560fee18aac158730f12a11f49d Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Wed, 25 May 2016 23:47:34 +0200 Subject: [PATCH] Clarify that string refs are considered legacy. (#6692) --- docs/08.1-more-about-refs.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/08.1-more-about-refs.md b/docs/08.1-more-about-refs.md index b14416f7..dc17cd3a 100644 --- a/docs/08.1-more-about-refs.md +++ b/docs/08.1-more-about-refs.md @@ -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. 1. Assign a `ref` attribute to anything returned from `render` such as: