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>

Issue
From your description and error it seems you've not added the connected router to your root reducer.
Solution
Import
connectRouterfunction and create the root reducer with arouterkey and pass thehistoryobject. Redux doesn't have a matching reducer, or specifically theconnected-react-routerselectors are attempting to select from non-existent state.Example from docs:
...
Import your history object and custom
createRootReducerfor use when creating your Redux store. Follow the rest of theconnected-react-routerdocs for specifics.Example: