Closed Lazarencjusz closed 2 years ago
This is simple case, everything visible on attached screenshoot:
This is how I create state and reducers:
import { RouterStore } from '@fair-cms/router'; import { configureStore } from '@reduxjs/toolkit'; import { CurriedGetDefaultMiddleware } from '@reduxjs/toolkit/dist/getDefaultMiddleware'; import { routerMiddleware } from 'connected-react-router'; import { RouteName } from '../model/RouteName'; import { appHistory } from '../utils/appHistory'; import { reducer } from './reducers'; const appRouterMiddleware = routerMiddleware(appHistory); export const store = configureStore({ reducer, middleware: (getDefaultMiddleware: CurriedGetDefaultMiddleware<RouterStore<RouteName>>) => [ ...getDefaultMiddleware({ thunk: false }), appRouterMiddleware, ], devTools: true, });
import { combineReducers } from '@reduxjs/toolkit'; import { connectRouter } from 'connected-react-router'; import { appHistory } from '../utils/appHistory'; export const router = connectRouter(appHistory); export const reducer = combineReducers({ router, });
import { createBrowserHistory } from 'history'; export const appHistory = createBrowserHistory();
What is going on here?
FYI: most probably it was because module history@5, when I switch back to history@4 works ok.
history@5
history@4
Question to maintainers: do you support history@5?
@Lazarencjusz Thanks for saving my life.
This is simple case, everything visible on attached screenshoot:
This is how I create state and reducers:
What is going on here?