It is worth noting that although ReactDOM.findDOMNode can be used today, in the future it will be deprecated instead of references to callbacks.
There is a post here by Dan Abramov that describes the reason not to use findDOMNode, providing examples of how to replace using ReactDOM.findDOMNode with a ref callback.
Since I saw how SO users were upset when only the link was included in the response, so I will give one of the examples that Dan kindly provided:
findDOMNode (stringDOMRef)
**Before:** class MyComponent extends Component { componentDidMount() { findDOMNode(this.refs.something).scrollIntoView(); } render() { return ( <div> <div ref='something' /> </div> ) } } **After:** class MyComponent extends Component { componentDidMount() { this.something.scrollIntoView(); } render() { return ( <div> <div ref={node => this.something = node} /> </div> ) } }
source share