How to redirect page with Javascript in React-Router?
<p>I using <code>react-router</code> in my application.</p>

<p>In my login page, I needing authentication with <code>ajax</code> and redirect if success.</p>

<p>Some like following code:</p>

<pre><code>class PageLogin extends React.Component {
    login() {
        // How to can I redirect to another page if auth success?
    }

    render() {
        return (
            &lt;div className="login-page"&gt;
                &lt;form action=""&gt;
                    &lt;div className="form-group"&gt;
                        &lt;label&gt;Username:&lt;/label&gt;
                        &lt;input type="text"/&gt;
                    &lt;/div&gt;
                    &lt;div className="form-group"&gt;
                        &lt;label&gt;Password:&lt;/label&gt;
                        &lt;input type="text"/&gt;
                    &lt;/div&gt;
                    &lt;div&gt;
                        &lt;button onClick={this.login}&gt;Login&lt;/button&gt;
                    &lt;/div&gt;
                &lt;/form&gt;
            &lt;/div&gt;
        )
    }
}
</code></pre>

<p>In my <code>login</code> function, how to can I redirect to another page if authentication success?</p>