diff --git a/docs/CustomApp.md b/docs/CustomApp.md index a05c30dfb1a..4a8ef8d2693 100644 --- a/docs/CustomApp.md +++ b/docs/CustomApp.md @@ -13,7 +13,7 @@ Fortunately, the `` component detects when it's used inside an existing R Beware that you need to know about [redux](http://redux.js.org/), [react-router](https://github.com/reactjs/react-router), and [redux-saga](https://github.com/yelouafi/redux-saga) to go further. -React-admin requires that the redux state contains at least 4 reducers: `admin`, `i18n`, `form`, and `routing`. You can add more, or replace some of them with your own, but you can't remove or rename them. As it relies on redux-form, react-router, and redux-saga, react-admin also expects the store to use their middlewares. +React-admin requires that the redux state contains at least 4 reducers: `admin`, `i18n`, `form`, and `router`. You can add more, or replace some of them with your own, but you can't remove or rename them. As it relies on redux-form, react-router, and redux-saga, react-admin also expects the store to use their middlewares. Here is the default store creation for react-admin: @@ -44,7 +44,7 @@ export default ({ admin: adminReducer, i18n: i18nReducer(locale, i18nProvider(locale)), form: formReducer, - routing: routerReducer, + router: routerReducer, { /* add your own reducers here */ }, }); const resettableAppReducer = (state, action) => diff --git a/packages/ra-core/src/reducer/index.js b/packages/ra-core/src/reducer/index.js index de30fc4aab6..7b356e89e36 100644 --- a/packages/ra-core/src/reducer/index.js +++ b/packages/ra-core/src/reducer/index.js @@ -14,7 +14,7 @@ export default (customReducers, locale, messages) => admin, i18n: i18nReducer(locale, messages), form: formReducer, - routing: routerReducer, + router: routerReducer, ...customReducers, }); diff --git a/packages/ra-core/src/sideEffect/auth.js b/packages/ra-core/src/sideEffect/auth.js index 0537b6b01a6..6530eb01637 100644 --- a/packages/ra-core/src/sideEffect/auth.js +++ b/packages/ra-core/src/sideEffect/auth.js @@ -16,11 +16,11 @@ import { import { FETCH_ERROR } from '../actions/fetchActions'; import { AUTH_LOGIN, AUTH_CHECK, AUTH_ERROR, AUTH_LOGOUT } from '../auth'; const nextPathnameSelector = state => { - const locationState = state.routing.location.state; + const locationState = state.router.location.state; return locationState && locationState.nextPathname; }; -const currentPathnameSelector = state => state.routing.location; +const currentPathnameSelector = state => state.router.location; export default authProvider => { if (!authProvider) return () => null; diff --git a/packages/ra-ui-materialui/src/layout/Menu.js b/packages/ra-ui-materialui/src/layout/Menu.js index a5c3627379a..f8d470a3933 100644 --- a/packages/ra-ui-materialui/src/layout/Menu.js +++ b/packages/ra-ui-materialui/src/layout/Menu.js @@ -85,7 +85,7 @@ Menu.defaultProps = { const mapStateToProps = state => ({ open: state.admin.ui.sidebarOpen, resources: getResources(state), - pathname: state.routing.location.pathname, // used to force redraw on navigation + pathname: state.router.location.pathname, // used to force redraw on navigation }); const enhance = compose(