If this component has been mounted into the DOM, this returns the corresponding native browser DOM element.
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
.
Note:
findDOMNode()
is an escape hatch used to access the underlying DOM node. In most cases, use of this escape hatch
is discouraged because it pierces the component abstraction.
findDOMNode()
only works on mounted components (that is, components that have been placed in the DOM). If you try
to call this on a component that has not been mounted yet (like calling findDOMNode()
in render()
on a
component that has yet to be created) an exception will be thrown.
findDOMNode()
cannot be used on stateless components.
Render a ReactElement into the DOM in the supplied container
and return a reference to the component (or returns
null
for stateless components).
Render a ReactElement into the DOM in the supplied container
and return a reference to the component (or returns
null
for stateless components).
If the ReactElement was previously rendered into container
, this will perform an update on it and only mutate
the DOM as necessary to reflect the latest React component.
If the optional callback is provided, it will be executed after the component is rendered or updated.
Note:
ReactDOM.render()
controls the contents of the container node you pass in. Any existing DOM elements
inside are replaced when first called. Later calls use React’s DOM diffing algorithm for efficient
updates.
ReactDOM.render()
does not modify the container node (only modifies the children of the container). In
the future, it may be possible to insert a component to an existing DOM node without overwriting
the existing children.
Render a ReactElement into the DOM in the supplied container
and return a reference to the component (or returns
null
for stateless components).
Render a ReactElement into the DOM in the supplied container
and return a reference to the component (or returns
null
for stateless components).
If the ReactElement was previously rendered into container
, this will perform an update on it and only mutate
the DOM as necessary to reflect the latest React component.
If the optional callback is provided, it will be executed after the component is rendered or updated.
Note:
ReactDOM.render()
controls the contents of the container node you pass in. Any existing DOM elements
inside are replaced when first called. Later calls use React’s DOM diffing algorithm for efficient
updates.
ReactDOM.render()
does not modify the container node (only modifies the children of the container). In
the future, it may be possible to insert a component to an existing DOM node without overwriting
the existing children.
Render a ReactElement into the DOM in the supplied container
and return a reference to the component (or returns
null
for stateless components).
Render a ReactElement into the DOM in the supplied container
and return a reference to the component (or returns
null
for stateless components).
If the ReactElement was previously rendered into container
, this will perform an update on it and only mutate
the DOM as necessary to reflect the latest React component.
If the optional callback is provided, it will be executed after the component is rendered or updated.
Note:
ReactDOM.render()
controls the contents of the container node you pass in. Any existing DOM elements
inside are replaced when first called. Later calls use React’s DOM diffing algorithm for efficient
updates.
ReactDOM.render()
does not modify the container node (only modifies the children of the container). In
the future, it may be possible to insert a component to an existing DOM node without overwriting
the existing children.
Render a ReactElement into the DOM in the supplied container
and return a reference to the component (or returns
null
for stateless components).
Render a ReactElement into the DOM in the supplied container
and return a reference to the component (or returns
null
for stateless components).
If the ReactElement was previously rendered into container
, this will perform an update on it and only mutate
the DOM as necessary to reflect the latest React component.
If the optional callback is provided, it will be executed after the component is rendered or updated.
Note:
ReactDOM.render()
controls the contents of the container node you pass in. Any existing DOM elements
inside are replaced when first called. Later calls use React’s DOM diffing algorithm for efficient
updates.
ReactDOM.render()
does not modify the container node (only modifies the children of the container). In
the future, it may be possible to insert a component to an existing DOM node without overwriting
the existing children.
Remove a mounted React component from the DOM and clean up its event handlers and state.
Remove a mounted React component from the DOM and clean up its event handlers and state. If no component was
mounted in the container, calling this function does nothing. Returns true
if a component was unmounted and
false
if there was no component to unmount.