Closed pdeva closed 9 years ago
I have code like this (in typescript)
import {createHistory} from 'history/lib/createBrowserHistory'; let rootReducer = combineReducers({ postsByReddit, router: reduxRouter.routerStateReducer }); export const reduxStore = compose(applyMiddleware(thunkMiddleware), reduxRouter.reduxReactRouter({ routes: routesFile.routes, createHistory: createHistory}) )(createStore)(rootReducer)
However, this fails with msg and no routes are loaded.
Uncaught TypeError: Cannot read property 'listen' of undefined
This is the code that triggers this:
This is how i render my router currently:
React.render(( <reactRedux.Provider store={reduxSetp.reduxStore}> {()=><ReduxRouter/>} </reactRedux.Provider> ) , document.getElementById('content'));
This only happens when i use redux-react-router, not with normal usage of react-router.
What am i doing wrong?
ok it turns out the import line should be:
import {createHistory} from 'history;
instead of
import {createHistory} from 'history/lib/createBrowserHistory';
This also means the example on Readme.md is incorrect.
I have code like this (in typescript)
However, this fails with msg and no routes are loaded.
This is the code that triggers this:
This is how i render my router currently:
This only happens when i use redux-react-router, not with normal usage of react-router.
What am i doing wrong?