Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const initialState = {
- previousLocation: null,
- currentLocation: null,
- };
- const routerLocations = function (state = initialState, action) {
- const newstate = { ...state };
- switch (action.type) {
- case "@@router/LOCATION_CHANGE":
- newState.previousLocation = state.currentLocation;
- newState.currentLocation = action.payload;
- return newState
- default:
- return state;
- }
- }
- export default routerLocations;
- "react-router": "^4.2.0",
- "react-router-dom": "^4.2.2",
- "react-router-redux": "^4.0.8",
Add Comment
Please, Sign In to add comment