diff --git a/src/components/App/Page.js b/src/components/App/Page.js index ef09fca9ed..d07a53565c 100644 --- a/src/components/App/Page.js +++ b/src/components/App/Page.js @@ -18,6 +18,7 @@ import * as React from 'react'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import type { Location } from 'react-router-dom'; +import { withRouter } from 'react-router-dom'; import TopNav from './TopNav'; import type { Config } from '../../types/config'; @@ -64,8 +65,8 @@ class Page extends React.Component { function mapStateToProps(state, ownProps) { const { config } = state; - const { location } = state.routing; + const { location } = state.router; return { ...ownProps, config, location }; } -export default connect(mapStateToProps)(Page); +export default withRouter(connect(mapStateToProps)(Page)); diff --git a/src/components/SearchTracePage/TraceSearchForm.js b/src/components/SearchTracePage/TraceSearchForm.js index 7f59a5dea6..202e4af578 100644 --- a/src/components/SearchTracePage/TraceSearchForm.js +++ b/src/components/SearchTracePage/TraceSearchForm.js @@ -213,7 +213,7 @@ const mapStateToProps = state => { minDuration, lookback, traceID: traceIDParams, - } = queryString.parse(state.routing.location.search); + } = queryString.parse(state.router.location.search); const nowInMicroseconds = moment().valueOf() * 1000; const today = formatDate(nowInMicroseconds); diff --git a/src/components/SearchTracePage/index.js b/src/components/SearchTracePage/index.js index b55dc1cf1e..5ba3d124df 100644 --- a/src/components/SearchTracePage/index.js +++ b/src/components/SearchTracePage/index.js @@ -200,7 +200,7 @@ const stateServicesXformer = getLastXformCacher(stateServices => { }); function mapStateToProps(state) { - const query = queryString.parse(state.routing.location.search); + const query = queryString.parse(state.router.location.search); const isHomepage = !Object.keys(query).length; const { traces, maxDuration, loading, traceError } = stateTraceXformer(state.trace); const { services, serviceError } = stateServicesXformer(state.services); diff --git a/src/utils/configure-store.js b/src/utils/configure-store.js index 703dc0d908..c722e817c1 100644 --- a/src/utils/configure-store.js +++ b/src/utils/configure-store.js @@ -25,7 +25,7 @@ export default function configureStore(history) { combineReducers({ ...jaegerReducers, traceTimeline: traceTimelineViewReducer, - routing: routerReducer, + router: routerReducer, }), compose( applyMiddleware( diff --git a/src/utils/configure-store.test.js b/src/utils/configure-store.test.js index 5fe0012dda..de4fcf1ef9 100644 --- a/src/utils/configure-store.test.js +++ b/src/utils/configure-store.test.js @@ -24,7 +24,7 @@ it('configureStore() should return the redux store', () => { expect(typeof store.subscribe === 'function').toBeTruthy(); expect(typeof store.replaceReducer === 'function').toBeTruthy(); - expect({}.hasOwnProperty.call(store.getState(), 'routing')).toBeTruthy(); + expect({}.hasOwnProperty.call(store.getState(), 'router')).toBeTruthy(); expect({}.hasOwnProperty.call(store.getState(), 'trace')).toBeTruthy(); expect({}.hasOwnProperty.call(store.getState(), 'form')).toBeTruthy(); });