You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/reference-react.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,8 +51,8 @@ See [Using React without JSX](/docs/react-without-jsx.html) for more information
51
51
52
52
### Refs
53
53
54
-
-[`React.forwardRef`](#reactforwardref)
55
54
-[`React.createRef`](#reactcreateref)
55
+
-[`React.forwardRef`](#reactforwardref)
56
56
57
57
* * *
58
58
@@ -223,14 +223,15 @@ render() {
223
223
224
224
You can also use it with the shorthand `<></>` syntax. For more information, see [React v16.2.0: Improved Support for Fragments](/blog/2017/11/28/react-v16.2.0-fragment-support.html).
225
225
226
+
227
+
### `React.createRef`
228
+
229
+
`React.createRef` creates a [ref](/docs/refs-and-the-dom.html) that can be attached to React elements via the ref attribute.
`React.forwardRef` accepts a render function that receives `props` and `ref` parameters and returns a React node. Ref forwarding is a technique for passing a [ref](/docs/refs-and-the-dom.html) through a component to one of its descendants. This technique can be particularly useful with [higher-order components](/docs/higher-order-components.html):
229
235
`embed:reference-react-forward-ref.js`
230
236
231
237
For more information, see [forwarding refs](/docs/forwarding-refs.html).
232
-
233
-
### `React.createRef`
234
-
235
-
`React.createRef` creates a [ref](/docs/refs-and-the-dom.html) that can be attached to React elements via the ref attribute.
0 commit comments