Module '"react-router-dom"' has no exported member 'RouteComponentProps'.
时间: 2024-01-10 07:01:50 浏览: 26
The error you are encountering is likely due to a mismatch between the version of `react-router-dom` you are using and the version of TypeScript you have installed.
In older versions of `react-router-dom`, the type `RouteComponentProps` was exported directly from the library. However, in newer versions, it is exported from the `react-router` package instead.
To resolve this issue, you can update your import statement to reference `react-router` instead of `react-router-dom` and import `RouteComponentProps` from there.
Here's an example of how you can update your import statement:
```typescript
import { RouteComponentProps } from 'react-router';
```
Make sure you have the latest version of `react-router` installed by running `npm install react-router`.
If you still encounter issues, please provide more details about your setup, such as the versions of `react-router-dom` and TypeScript you are using, as well as any relevant code.
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)