From 962ef9a56741e2621301208e4fe68138976bb944 Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Tue, 6 Mar 2018 00:50:44 -0800 Subject: [PATCH] Highlight deprecation notice --- content/docs/refs-and-the-dom.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/docs/refs-and-the-dom.md b/content/docs/refs-and-the-dom.md index 0fc033df..796f04ff 100644 --- a/content/docs/refs-and-the-dom.md +++ b/content/docs/refs-and-the-dom.md @@ -328,7 +328,11 @@ In the example above, `Parent` passes its ref callback as an `inputRef` prop to ### Legacy API: String Refs -If you worked with React before, you might be familiar with an older API where the `ref` attribute is a string, like `"textInput"`, and the DOM node is accessed as `this.refs.textInput`. We advise against it because string refs have [some issues](https://github.com/facebook/react/pull/8333#issuecomment-271648615), are considered legacy, and **are likely to be removed in one of the future releases**. If you're currently using `this.refs.textInput` to access refs, we recommend the callback pattern instead. +If you worked with React before, you might be familiar with an older API where the `ref` attribute is a string, like `"textInput"`, and the DOM node is accessed as `this.refs.textInput`. We advise against it because string refs have [some issues](https://github.com/facebook/react/pull/8333#issuecomment-271648615), are considered legacy, and **are likely to be removed in one of the future releases**. + +> Note +> +> If you're currently using `this.refs.textInput` to access refs, we recommend the callback pattern instead. ### Caveats with callback refs