Skip to content

Commit 861544b

Browse files
authored
Move createRef above forwardRef
1 parent 3709c8e commit 861544b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

content/docs/reference-react.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ See [Using React without JSX](/docs/react-without-jsx.html) for more information
5151

5252
### Refs
5353

54-
- [`React.forwardRef`](#reactforwardref)
5554
- [`React.createRef`](#reactcreateref)
55+
- [`React.forwardRef`](#reactforwardref)
5656

5757
* * *
5858

@@ -223,14 +223,15 @@ render() {
223223
224224
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).
225225
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.
230+
`embed:16-3-release-blog-post/create-ref-example.js`
231+
226232
### `React.forwardRef`
227233
228234
`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):
229235
`embed:reference-react-forward-ref.js`
230236
231237
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.
236-
`embed:16-3-release-blog-post/create-ref-example.js`

0 commit comments

Comments
 (0)