Skip to content

Commit

Permalink
Refs and the DOM: clarify when ref callbacks are invoked (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
dminkovsky authored and alexkrolick committed Jul 19, 2018
1 parent 48cbb02 commit 7f1b367
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/docs/refs-and-the-dom.md
Expand Up @@ -251,7 +251,7 @@ class CustomTextInput extends React.Component {
}
```

React will call the `ref` callback with the DOM element when the component mounts, and call it with `null` when it unmounts. `ref` callbacks are invoked before `componentDidMount` or `componentDidUpdate` lifecycle hooks.
React will call the `ref` callback with the DOM element when the component mounts, and call it with `null` when it unmounts. Refs are guaranteed to be up-to-date before `componentDidMount` or `componentDidUpdate` fires.

You can pass callback refs between components like you can with object refs that were created with `React.createRef()`.

Expand Down

0 comments on commit 7f1b367

Please sign in to comment.