Skip to content

Commit 17efddc

Browse files
authored
Merge pull request #756 from raunofreiberg/createref-docs
Add createRef to top level API section
2 parents 1dccf07 + 861544b commit 17efddc

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

content/docs/reference-react.md

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

5050
- [`React.Fragment`](#reactfragment)
5151

52-
### Other
52+
### Refs
5353

54+
- [`React.createRef`](#reactcreateref)
5455
- [`React.forwardRef`](#reactforwardref)
5556

5657
* * *
@@ -222,9 +223,15 @@ render() {
222223
223224
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).
224225
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+
225232
### `React.forwardRef`
226233
227234
`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):
228235
`embed:reference-react-forward-ref.js`
229236
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

Comments
 (0)