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
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,8 +49,9 @@ See [Using React without JSX](/docs/react-without-jsx.html) for more information
49
49
50
50
-[`React.Fragment`](#reactfragment)
51
51
52
-
### Other
52
+
### Refs
53
53
54
+
-[`React.createRef`](#reactcreateref)
54
55
-[`React.forwardRef`](#reactforwardref)
55
56
56
57
* * *
@@ -222,9 +223,15 @@ render() {
222
223
223
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).
224
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):
228
235
`embed:reference-react-forward-ref.js`
229
236
230
-
For more information, see [forwarding refs](/docs/forwarding-refs.html).
237
+
For more information, see [forwarding refs](/docs/forwarding-refs.html).
0 commit comments