diff --git a/admin/client/src/boot/index.js b/admin/client/src/boot/index.js index 231e491f2e5..9539be18f8d 100644 --- a/admin/client/src/boot/index.js +++ b/admin/client/src/boot/index.js @@ -23,6 +23,7 @@ import BreadcrumbsReducer from 'state/breadcrumbs/BreadcrumbsReducer'; import TextField from 'components/TextField/TextField'; import HiddenField from 'components/HiddenField/HiddenField'; import GridField from 'components/GridField/GridField'; +import { syncHistoryWithStore, routerReducer } from 'react-router-redux'; // Sections // eslint-disable-next-line no-unused-vars @@ -32,9 +33,12 @@ function initReactRouter(store) { routeRegister.updateRootRoute({ component: App, }); - const history = useRouterHistory(createHistory)({ - basename: Config.get('adminUrlBase'), - }); + let history = syncHistoryWithStore( + useRouterHistory(createHistory)({ + basename: Config.get('adminUrlBase'), + }), + store + ); ReactDOM.render( ` })) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ab7978e37bf..d295f38bfcd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -13429,6 +13429,10 @@ } } }, + "react-router-redux": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/react-router-redux/-/react-router-redux-4.0.5.tgz" + }, "redux": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/redux/-/redux-3.0.5.tgz" diff --git a/package.json b/package.json index 0ce40a644e2..61c7c0930a1 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "react-dom": "^0.14.8", "react-redux": "^4.4.1", "react-router": "^2.4.1", + "react-router-redux": "^4.0.5", "redux": "https://registry.npmjs.org/redux/-/redux-3.0.5.tgz", "redux-thunk": "^2.1.0", "tinymce": "^4.3.3",