File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 11import React from 'react'
2- import { BrowserRouter } from 'react-router-dom'
2+ import { Router as ReactRouter } from 'react-router-dom'
3+ import { createBrowserHistory } from 'history'
34
45interface Props {
56 children : React . ReactElement
@@ -13,8 +14,10 @@ if (RIPROXYPATH !== '') {
1314 MOUNT_PATH = RIPROXYPATH
1415}
1516
17+ export const history = createBrowserHistory ( { basename : MOUNT_PATH } )
18+
1619const Router = ( { children } : Props ) => (
17- < BrowserRouter basename = { MOUNT_PATH } > { children } </ BrowserRouter >
20+ < ReactRouter history = { history } > { children } </ ReactRouter >
1821)
1922
2023export default Router
Original file line number Diff line number Diff line change 1- import { createBrowserHistory } from 'history'
21import { configureStore , combineReducers } from '@reduxjs/toolkit'
32
43import { getConfig } from 'uiSrc/config'
@@ -59,8 +58,6 @@ import tagsReducer from './instances/tags'
5958
6059const riConfig = getConfig ( )
6160
62- export const history = createBrowserHistory ( )
63-
6461export const rootReducer = combineReducers ( {
6562 app : combineReducers ( {
6663 info : appInfoReducer ,
@@ -149,7 +146,9 @@ const store = configureStore({
149146 devTools : riConfig . app . env !== 'production' ,
150147} )
151148
152- export { store }
149+ const dispatch = store . dispatch
150+
151+ export { store , dispatch }
153152
154153export type ReduxStore = typeof store
155154export type RootState = ReturnType < typeof rootReducer >
Original file line number Diff line number Diff line change 1- import { createBrowserHistory } from 'history'
2-
31import type { ReduxStore } from 'uiSrc/slices/store'
42
53// Re-export all types and exports from the real store to avoid circular dependencies during tests
64
75export type { RootState , AppDispatch , ReduxStore } from 'uiSrc/slices/store'
8- export const history = createBrowserHistory ( )
96
107// Lazy reference to avoid circular dependencies
118// The store will be set by the store module itself after it's created
You can’t perform that action at this time.
0 commit comments