title: Is there a method to reset a react component using ES6 classes to its initial state?
body: <p>I am writing a game and when the game is over, I want it to reset to the initial state. I haven't found any meaningful information in the docs for this, so I've been playing around with adding a reset method to my Game class. First, I attempted doing the follow in hopes of creating a base class I could extend later, but using a variable for the component name fails:</p>
  
  <pre><code>class Game extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
        ...
      };
    }
  
    reset() {
      var node = ReactDOM.findDOMNode(this),
          ComponentName = this.constructor.name;
      if (node) {
        ReactDOM.unmountComponentAtNode(node);
        ReactDOM.render(&lt;ComponentName /&gt;, node);
      }
    }
  
    ...
  }
  </code></pre>
  
  <p>I moved on, and tried to hardcode the component name as follows:</p>
  
  <pre><code>class Game extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
        ...
      };
    }
  
    reset() {
      var node = ReactDOM.findDOMNode(this);
      if (node) {
        ReactDOM.unmountComponentAtNode(node);
        ReactDOM.render(&lt;Game /&gt;, node);
      }
    }
  
    ...
  }
  </code></pre>
  
  <p>This works really well, but I am wondering if there is a built-in way that is better, or a more generic way.</p>