Redux store is lost in next route on replace() inside onEnter
<p>So, similar to the code in <code>router.js</code>, in the boilerplate at <a href="https://github.com/erikras/react-redux-universal-hot-example/" rel="nofollow">https://github.com/erikras/react-redux-universal-hot-example/</a> <code>master branch</code></p>

<pre><code>const requireLogin = (nextState, replace, cb) =&gt; {

    if(!isLoggedIn) {
        store.dispatch(getUserInfo(somePayLoad)).then(checkLoginStatus);
    }
    function checkLoginStatus() {
        const {authorization: { user }} = store.getState();
        if(!user.typeA) {
            replace('/home');
        }
        cb();
    }
}
</code></pre>

<p>So, when I <code>replace()</code>, and if the if condition <code>!user.typeA</code> fails, then it goes to the usual called route, access the user details that were fetched as in above code and also, I can easily call <code>logout</code> dispatcher I wrote whenever user wants to exit. But when if condition is passed, it replaces to <code>/home</code> page and opens(redirects) to home page successfully. But I can no longer have user details in <code>authorization</code> store. Neither I can call <code>logout</code> dispatcher.</p>

<p><strong>Note:</strong></p>

<pre><code>  if(!user.typeA) {
      const path = '/home';
      const query = {error:'anything'};
      const state = store.getState();
      replace({ path, query, state });
  }
</code></pre>

<p>instead of </p>

<pre><code>  if(!user.typeA) {
      replace('/home')
  }
</code></pre>

<p>also doesn't work.</p>

<p>How to achieve this?</p>