Skip to content

Commit f456a7a

Browse files
ferdabergaearon
authored andcommitted
feat(react-dom-reference): update findDOMNode API (#202)
* feat(react-dom-reference): update findDOMNode API * Fixed confusing wording on findDOMNode * Reword and make more precise
1 parent a468658 commit f456a7a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

content/docs/reference-react-dom.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ Remove a mounted React component from the DOM and clean up its event handlers an
9595
```javascript
9696
ReactDOM.findDOMNode(component)
9797
```
98-
If this component has been mounted into the DOM, this returns the corresponding native browser DOM element. This method is useful for reading values out of the DOM, such as form field values and performing DOM measurements. **In most cases, you can attach a ref to the DOM node and avoid using `findDOMNode` at all.** When `render` returns `null` or `false`, `findDOMNode` returns `null`.
98+
If this component has been mounted into the DOM, this returns the corresponding native browser DOM element. This method is useful for reading values out of the DOM, such as form field values and performing DOM measurements. **In most cases, you can attach a ref to the DOM node and avoid using `findDOMNode` at all.**
99+
100+
When a component renders to `null` or `false`, `findDOMNode` returns `null`. When a component renders to a string, `findDOMNode` returns a text DOM node containing that value. As of React 16, a component may return a fragment with multiple children, in which case `findDOMNode` will return the DOM node corresponding to the first non-empty child.
99101

100102
> Note:
101103
>

0 commit comments

Comments
 (0)