Browse Source

Refs and the DOM: clarify when ref callbacks are invoked (#1069)

main
Dmitry Minkovsky 7 years ago
committed by Alex Krolick
parent
commit
7f1b367eb6
  1. 2
      content/docs/refs-and-the-dom.md

2
content/docs/refs-and-the-dom.md

@ -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()`.

Loading…
Cancel
Save