Skip to content

How to get redux application state in onEnter? #66

@rightaway

Description

@rightaway

When I add the onEnter to a route, I get several errors about ReduxRouterContext and the page doesn't load.

const routes = (
  <Route path='/' component={App}>
    <Route path='profile' component={Profile} onEnter={requireAuth} />
    <Route path='*' component={NotFound} />
  </Route>
);

...

React.render((
  <div>
    <Provider store={store}>
      {() => <ReduxRouter />}
    </Provider>
    <DebugPanel top right bottom>
      <DevTools store={store} monitor={LogMonitor} />
    </DebugPanel>
  </div>
), document.getElementById('app'));
Warning: Failed propType: Required prop `location` was not specified in `RoutingContext`. Check the render method of `ReduxRouterContext`. bundle.js:13484:8
Warning: Failed propType: Required prop `routes` was not specified in `RoutingContext`. Check the render method of `ReduxRouterContext`. bundle.js:13484:8
Warning: Failed propType: Required prop `params` was not specified in `RoutingContext`. Check the render method of `ReduxRouterContext`. bundle.js:13484:8
Warning: Failed propType: Required prop `components` was not specified in `RoutingContext`. Check the render method of `ReduxRouterContext`. bundle.js:13484:8
Warning: Failed Context Types: Required child context `location` was not specified in `RoutingContext`. Check the render method of `ReduxRouterContext`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions