How to Access styles from React? : <p>I am trying to access the width and height styles of a div in React but I have been running into one problem. This is what I got so far: </p>

<pre><code>componentDidMount()  {
  console.log(this.refs.container.style);     
}


render()  {
   return (
      &lt;div ref={"container"} className={"container"}&gt;&lt;/div&gt;  //set reff
   );
}
</code></pre>

<p>This works but the output that I get is a CSSStyleDeclaration object and in the all property I can all the CSS selectors for that object but they none of them are set. They are all set to an empty string. </p>

<p>This is the output of the CSSStyleDecleration is: <a href="http://pastebin.com/wXRPxz5p" rel="noreferrer">http://pastebin.com/wXRPxz5p</a></p>

<p>Any help on getting to see the actual styles (event inherrited ones) would be greatly appreciated!</p>

<p>Thanks!</p>
