React + Redux Simple Router : cannot find listen of undefined
<p>I've been trying to setup <code>react</code> + <code>react-router</code> + <code>redux</code> + <code>redux-simple-router</code> with no success. Everything seems to work fine until I add <code>redux-simple-router</code> to the mix, after which I get </p>

<p><code>"[TypeError: Cannot read property 'listen' of undefined]</code> even though I am passing in BrowserHistory Object.</p>

<p>Here's the code - </p>

<pre><code>import React from 'react'
import ReactDOM from 'react-dom'
import { Route, Router, BrowserHistory } from 'react-router';
import HashHistory from 'react-router/lib/HashHistory';
import { compose, combineReducers, applyMiddleware, createStore } from 'redux'
import { Provider } from 'react-redux'
import { syncHistory, routeReducer } from 'redux-simple-router'
import * as reducers from 'reducers/reducers'

import Blank from 'routes/blank';

export default (withHistory, onUpdate) =&gt; {


const reducer = combineReducers(Object.assign({}, reducers, {
  routing: routeReducer
}));

const reduxRouterMiddleware = syncHistory(BrowserHistory)
const createStoreWithMiddleware = applyMiddleware(reduxRouterMiddleware)(createStore)

const store = createStoreWithMiddleware(reducer)

  return (
    &lt;Provider store={store}&gt;
      &lt;Router history={BrowserHistory} onUpdate={onUpdate}&gt;
        &lt;Route path='/' component={Blank} /&gt;
      &lt;/Router&gt;
    &lt;/Provider&gt;
  );
};
</code></pre>

<p><strong>Note:</strong> I just discovered I'm compiling react templates in a express server using <code>renderToString()</code>. Is that why its not defined?? What do i do?</p>

<p><strong>Note 2:</strong> if I instead <code>import BrowserHistory from 'react-router/lib/BrowserHistory'</code> then I get </p>

<p><code>TypeError: history.listen is not a function</code>;</p>