Skip to content

Commit 3ecd11f

Browse files
committed
chore:修复react-router
1 parent 29366c0 commit 3ecd11f

File tree

9 files changed

+21
-32
lines changed

9 files changed

+21
-32
lines changed

examples/base/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"react": "~17.0.2",
3434
"react-dom": "~17.0.2",
3535
"react-redux": "~7.2.6",
36-
"react-router": "~6.2.1",
37-
"react-router-dom": "~6.2.1",
36+
"react-router": "~6.4.3",
37+
"react-router-dom": "~6.4.3",
3838
"swr": "^1.3.0",
3939
"uiw": "^4.21.13"
4040
},

examples/website/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"@uiw/reset.css": "1.0.5",
3838
"react": "~17.0.2",
3939
"react-dom": "~17.0.2",
40-
"react-router": "~6.2.1",
41-
"react-router-dom": "~6.2.1",
40+
"react-router": "~6.4.3",
41+
"react-router-dom": "~6.4.3",
4242
"react-test-renderer": "17.0.2",
4343
"uiw": "^4.21.13",
4444
"uiw-admin": "5.3.20"

packages/authorized/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@types/react-dom": "~17.0.11",
5454
"react": "~17.0.2",
5555
"react-dom": "~17.0.2",
56-
"react-router": "~6.2.1",
57-
"react-router-dom": "~6.2.1"
56+
"react-router": "~6.4.3",
57+
"react-router-dom": "~6.4.3"
5858
}
5959
}

packages/basic-layouts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"@uiw-admin/router-control": "5.3.20",
5757
"react": "~17.0.2",
5858
"react-dom": "~17.0.2",
59-
"react-router": "~6.2.1",
60-
"react-router-dom": "~6.2.1",
59+
"react-router": "~6.4.3",
60+
"react-router-dom": "~6.4.3",
6161
"uiw": "^4.15.0"
6262
}
6363
}

packages/components/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
"@types/react-dom": "~17.0.11",
5858
"react": "~17.0.2",
5959
"react-dom": "~17.0.2",
60-
"react-router": "~6.2.1",
61-
"react-router-dom": "~6.2.1",
60+
"react-router": "~6.4.3",
61+
"react-router-dom": "~6.4.3",
6262
"uiw": "^4.15.0"
6363
}
6464
}

packages/exceptions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"@types/react-dom": "~17.0.11",
5252
"react": "~17.0.2",
5353
"react-dom": "~17.0.2",
54-
"react-router": "~6.2.1",
55-
"react-router-dom": "~6.2.1",
54+
"react-router": "~6.4.3",
55+
"react-router-dom": "~6.4.3",
5656
"uiw": "^4.15.0"
5757
}
5858
}

packages/layout-tabs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
"@uiw-admin/router-control": "5.3.20",
5555
"react": "~17.0.2",
5656
"react-dom": "~17.0.2",
57-
"react-router": "~6.2.1",
58-
"react-router-dom": "~6.2.1",
57+
"react-router": "~6.4.3",
58+
"react-router-dom": "~6.4.3",
5959
"uiw": "^4.15.0"
6060
}
6161
}

packages/router-control/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
"react": ">=17.x",
4444
"react-dom": ">=17.x"
4545
},
46+
"dependencies": {
47+
"history": "5.3.0"
48+
},
4649
"devDependencies": {
4750
"@babel/runtime": "~7.20.0",
4851
"@types/react": "~17.0.39",
@@ -53,7 +56,7 @@
5356
"react": "~17.0.2",
5457
"react-dom": "~17.0.2",
5558
"react-redux": "~7.2.6",
56-
"react-router": "~6.2.1",
57-
"react-router-dom": "~6.2.1"
59+
"react-router": "~6.4.3",
60+
"react-router-dom": "~6.4.3"
5861
}
59-
}
62+
}

packages/router-control/src/index.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// @ts-nocheck
22
import React from 'react';
33
import {
4-
unstable_HistoryRouter,
54
useRoutes,
65
useNavigate,
76
NavigateFunction,
@@ -10,7 +9,6 @@ import {
109
BrowserRouter,
1110
} from 'react-router-dom';
1211

13-
// @ts-ignore
1412
import RoutePathArr from '@@/routes';
1513
import { Provider } from 'react-redux';
1614
import { store } from '@uiw-admin/models';
@@ -24,7 +22,6 @@ export * from 'react-router-dom';
2422
export * from 'react-router';
2523
export * from 'react-redux';
2624

27-
export const HistoryRouter = unstable_HistoryRouter;
2825
export const history = createBrowserHistory();
2926
export let navigate: NavigateFunction = () => {};
3027

@@ -78,18 +75,7 @@ export default function Controller(props: ControllerProps = {}) {
7875
// @ts-ignore
7976
let base = BASE_NAME;
8077
const dom = React.useMemo(() => {
81-
if (routeType === 'history') {
82-
return (
83-
<HistoryRouter history={history} basename={base}>
84-
<RouteChild
85-
addModels={props.addModels}
86-
isAutoAuth={isAutoAuth}
87-
notLoginMenus={notLoginMenus}
88-
navigateTo={navigateTo}
89-
/>
90-
</HistoryRouter>
91-
);
92-
} else if (routeType === 'browser') {
78+
if (routeType === 'browser') {
9379
return (
9480
<BrowserRouter window={window} basename={base}>
9581
<RouteChild

0 commit comments

Comments
 (0)