title: Trying to use React.DOM to set body styles
body: <p>How can I use React.DOM to change styles on HTML <code>body</code>?</p>
  
  <p>I tried this code and it's not working:</p>
  
  <pre><code>var MyView = React.createClass({
    render: function() {
      return (
        &lt;div&gt;
          React.DOM.body.style.backgroundColor = "green";
          Stuff goes here.
        &lt;/div&gt;
      );
    }
  });
  </code></pre>
  
  <p>If you execute this from the browsers console it works (but I need it working in ReactJS code):
  <code>document.body.style.backgroundColor = "green";</code></p>
  
  <p>Also see this question for similar but different solution:
  <a href="https://stackoverflow.com/questions/25473414/change-page-background-color-with-each-route-using-reactjs-and-react-router">Change page background color with each route using ReactJS and React Router?</a></p>