React-router v2: how to use the 'replace' function in callbacks
<p>When using "onEnter" property in React-router, the <strong>replace()</strong> function doesn't work for me in callbacks. It works fine when it is called in a synchronous way (not in callbacks):</p>

<pre><code>function verifyEmail(nextState, replace) {
     replace({pathname: '/list'});
}

&lt;Route path="/" component={App}&gt;
        &lt;Route path="/verify-email/:token" component={AppNotFound} onEnter={verifyEmail}/&gt;
&lt;/Route&gt;
</code></pre>

<p>However, it stops working when it is used in callbacks like this:</p>

<pre><code>function verifyEmail(nextState, replace) {
    console.log("replace", replace);
    Accounts.verifyEmail( nextState.params.token, function(error){
        if ( error ) {
            console.log(error.reason);
        } else {
            console.log("verified successfully!");
            replace({pathname: '/list'});
        }
    });
}

&lt;Route path="/" component={App}&gt;
        &lt;Route path="/verify-email/:token" component={AppNotFound} onEnter={verifyEmail}/&gt;
&lt;/Route&gt;
</code></pre>

<p>The console log will show "verified successfully", but it doesn't actually redirect the page. </p>