I am using these versions
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react-router-dom": "^5.2.0"
"connected-react-router": "^6.8.0"
"history": "4.10.1"
export const browserHistory = createBrowserHistory({ basename: '/clearance-authorization' })
i am getting this Error Could not find router reducer in state tree, it must be mounted under "router"
reducers.js
export default (history) => {
const appReducer = (asyncReducer) => {
return combineReducers({
notifications,
router: connectRouter(history),
...asyncReducer
})
}
const rootReducer = (state, action) => appReducer(state, action)
return rootReducer
}
store.js
import { createBrowserHistory } from 'history'
export const history = createBrowserHistory({
basename: '/clearance'
})
const middleware = [routerMiddleware(history), sagaMiddleware, notifications]
const configureStore = (initialState) => {
const store = createStore(
createReducer(history),
initialState,
compose(
applyMiddleware(...middleware),
getReduxDevTools(process.env.NODE_ENV === 'development')
)
)
store.asyncReducers = {}
store.runSaga = sagaMiddleware.run
store.close = () => store.dispatch(END)
return store
}
export default configureStore
App.js
import configureStore, { history } from './redux/store'
import { ConnectedRouter } from 'connected-react-router'
<Provider store={store}>
<ConnectedRouter history={history}>
<Frame handleScrolling={false}>
</Frame>
</ConnectedRouter>
</Provider>
changed the code in reducers reducers.js