React: To know size of the element before it gets rendered : <p>Suppose that a component needs to know its size before it renders. With my knowledge I can do this:
render the component, in componentDidMount get the DOM node and extract size out of it, update state with that size, and then render again (lets not make it complicated with event listeners I'd attach to window's resize event, lets assume that window doesn't resize)
It works but seems dirty, the first render is just waste of resources, I wanna know the size of the element (or its container) before it's rendered, I know most of the time the element itself declares the size, but there are some situations when parent element declares the size and my case is one of those situations.
So to sum it up, is there any way to access parent element of a react component before it gets rendered (in componentWillMount)?</p>

<p>P.S. I know react-dimmensions, but I'd like a simpler solution that doesn't need external plugins. I just wanna know if it's possible to access parent node in componentWillMount in react or not.</p>
