Should I use ref or findDOMNode to get react root dom node of an element?
问题 I'm on a situation where I want to make some dom-node size calculations (top, bottom and size properties of the rendered DOM node) What I'm doing right now, on the componentDidUpdate method is to call findDOMNode on this: componentDidUpdate() { var node = ReactDOM.findDOMNode(this); this.elementBox = node.getBoundingClientRect(); this.elementHeight = node.clientHeight; // Make calculations and stuff } This is working fine, but I'm a bit worried about performance, and react best practices.