Simple login using ReactJS
No, you are re-rendering the application manually.

function ShowSuccessAtDOM(id, name) {
  ReactDOM.unmountComponentAtNode(document.getElementById(id));
  ReactDOM.render(
    &lt;LoginSuccess name={name} /&gt;,
    document.getElementById(id)
  );
};

function ShowFailureAtDOM(id) {
  ReactDOM.unmountComponentAtNode(document.getElementById(id));
  ReactDOM.render(
    &lt;LoginFail /&gt;,
    document.getElementById(id)
  );
};


Better:

class LoginApp extends Component {
  constructor(props) {
    super(props)
  }

  render() {
    return (
      &lt;div&gt;
        {this.props.errors.length &gt; 0 &amp;&amp; &lt;LoginFailure {...props} /&gt;}
        {this.props.success &amp;&amp; &lt;h1&gt;You are logged in!&lt;/h1&gt;}
        {!this.props.success &amp;&amp; &lt;LoginForm /&gt;}
      &lt;/div&gt;
    );
  }
}


ReactDOM.render(&lt;LoginApp {...props} /&gt;,
                document.getElementById('react-root'))


Too pass the props into your application, there are many ways. One of the most popular is using some kind of flux architecture. There is a library called redux. Its really easy to use, you should take a look, then you will understand how easy it is, to implement the example above.