-
Notifications
You must be signed in to change notification settings - Fork 199
Closed
Description
Hey, great work you're doing with redux-react-router!
I tested the next implementation with an existing project that relies on the onEnter hook for authentication. The problem I'm facing is that the store is not available when routes invoke these hooks.
Example
function requireAuth() {
// At this point I need to access the store in order
// to get information about the user
}
const routes = {
component: Application,
onEnter: requireAuth,
childRoutes: [ /* ... */ ]
}
const reducer = combineReducers(reducers);
const finalCreateStore = compose(
reduxReactRouter({routes, createHistory}),
/* ... */
);
const store = finalCreateStore(createStore)(reducer);Any ideas how to make the store available for the onEnter hook?
Metadata
Metadata
Assignees
Labels
No labels