Hacker News new | ask | show | jobs
by spicyj 4000 days ago
If you use a ref to a DOM component, you don't need ReactDOM.findDOMNode at all. Calling findDOMNode on a composite drills through abstraction boundaries and breaks encapsulation, so it's rarely what you should do.

The removal of .getDOMNode() was intentionally done in concert with this change: previously, all component classes created with React would magically have that DOM-specific method added to them; this way, component classes are less tied to specific rendering environments. If you need to call ReactDOM.findDOMNode then yes, your components will be tied to the ReactDOM renderer.