I have a project and with this project I have a login page and I want to use "RouteComponentProps", but I got this error:
Module '"react-router-dom"' has no exported member 'RouteComponentProps'.
And I tried to import it via "react-router", but it appeared to me:
Module '"react-router"' has no exported member 'RouteComponentProps'.
How can I solve the problem?
This is part of the file I used "RouteComponentProps":
signin.tsx:
import { RouteComponentProps } from 'react-router-dom';
interface Props {
history: RouteComponentProps['history']
}
package.json:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@material-ui/styles": "^4.11.4",
"@reach/router": "^1.3.4",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.24",
"@types/node": "^12.20.37",
"@types/react": "^17.0.37",
"@types/react-dom": "^17.0.11",
"@types/react-redux": "^7.1.20",
"axios": "^0.24.0",
"history": "^5.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.6",
"react-router": "^6.1.1",
"react-router-dom": "^6.1.1",
"react-scripts": "4.0.3",
"redux": "^4.1.2",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.4.1",
"thunk": "0.0.1",
"typescript": "^4.5.2",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/react-router": "^5.1.17",
"@types/react-router-dom": "^5.3.2",
"miragejs": "^0.1.43"
}
}