This repository was archived by the owner on Oct 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 637
with react-router 4.X and react-router-redux 5.0, the devTools can not replay different path #617
Copy link
Copy link
Closed
Description
the dependencies is
"react-dom": "^15.6.1",
"react-hot-loader": "^3.0.0-beta.7",
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.9",
"redux": "^3.6.0",
devDependencies is
"redux-devtools": "^3.0.0-beta-3",
"redux-devtools-dock-monitor": "^1.0.0-beta-3",
"redux-devtools-log-monitor": "^1.0.0-beta-3"
the entry file is
import createHistory from 'history/createBrowserHistory';
const history = createHistory();
const store = createStore(history, window.__INITIAL_STATE__);
import { Provider } from 'react-redux';
import { Switch, Route } from 'react-router-dom';
import { ConnectedRouter } from 'react-router-redux';
import DevTools from '../store/DevTools';
return (
<Provider store={store}>
<div>
<ConnectedRouter history={history}>
<Switch>
<Route key={newContextPath} component={item.component} path={newContextPath} exact />
</Switch>
</ConnectedRouter>
<DevTools />
</div>
</Provider>
);
the create Store is
import {applyMiddleware, compose, createStore as createReduxStore} from 'redux';
import {routerMiddleware} from 'react-router-redux';
import thunk from 'redux-thunk';
import logger from 'redux-logger';
import DevTools from './DevTools';
// ======================================================
const middleware = [thunk, logger, routerMiddleware(history)];
// ======================================================
// Store Enhancers
// ======================================================
const enhancers = [];
let composeEnhancers = compose;
// ======================================================
// Store Instantiation and HMR Setup
// ======================================================
const store = createReduxStore(
combineReducers({
user: userReducer,
router: routerReducer,
...asyncReducers
});
// initialState,
composeEnhancers(
applyMiddleware(...middleware),
DevTools.instrument(),
...enhancers
)
);
the route->location is changed in store when we change to the different route, but the replay is not working.
http://127.0.0.1 to http://127.0.0.1/count, it stayed in the 'count' path, not return to the index.
Metadata
Metadata
Assignees
Labels
No labels