Module '"react-router"' has no exported member 'PartialRouteObject'
Closed this issue · 2 comments
ctk41 commented
When I run your project, then I got the errors bellow. Please check
TypeScript error in D:/18.React/react-antd-admin/src/routes/index.tsx(5,10):
Module '"react-router"' has no exported member 'PartialRouteObject'. TS2305
3 | import LoginPage from 'pages/login';
4 | import LayoutPage from 'pages/layout';
5 | import { PartialRouteObject } from 'react-router';
| ^
6 | import WrapperRouteComponent from './config';
7 | import { useRoutes } from 'react-router-dom';
WinmezzZ commented
Seems like a problem with the react-router-dom
version being automatically upgraded.
There's two way to fix this.
- Try to lock version of
react-router-dom
to6.0.0-beta.0
inpackage.json
{
"react-router-dom": "6.0.0-beta.0"
}
- or use
RouteProps
insteadofPartialRouteObject
WinmezzZ commented
fixed in
react-antd-admin/src/routes/index.tsx
Line 5 in 0586342