React version:
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-router-dom": "5.0.1",
"react-scripts": "3.4.0",
js code as
import {useLocation} from "react-router-dom";
const location = useLocation();
...... where is the problem?
i am having the same isuue with react-router-dom version 6.6.1.any fixes???
Try uninstalling and reinstalling the "react-router-dom" Then, for safety, run npm i
and npm start
. Also, if you're using TS, you have to also install "@types/react-router-dom" as a dev dependency
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.