MENU
ReactDOM.X
So far we have learned about ReactDOM.createRoot(container).render(element), root.unmount(), and ReactDOM.createPortal().
ReactDOM.findDOMNode(component) (removed entirely as of React 19)
findDOMNode was an escape hatch used to access the underlying DOM node of a class component instance. Its use was already discouraged because it pierces the component abstraction, and it was disallowed inside StrictMode; React 19 goes further and removes it outright rather than merely warning about it. If you're maintaining older code that still calls it, attach a ref to the DOM node you need instead — refs work in both class and function components and don't require this escape hatch.
For historical reference: when mounted, this used to return the corresponding native browser DOM element, which was useful for reading values out of the DOM, such as form field values, and for performing DOM measurements.
If a mounted class component rendered to 'null' or 'false', findDOMNode returned null; if it rendered to a string, findDOMNode returned a text DOM node containing that value; and as of React 16, a component could return a fragment with multiple children, in which case findDOMNode returned the DOM node corresponding to the first non-empty child.
findDOMNode only ever worked on mounted components (that is, components that had already been placed in the DOM); calling it on a component that hadn't mounted yet threw an exception.
findDOMNode was never usable on function components — one more reason refs are the better choice going forward.