@报错:TypeError: Cannot read property ‘location’ of undefined
报错:TypeError: Cannot read property ‘location’ of undefined
这样的情况自己在用react-router-dom时引用路由组件时遇到,我发现是自己引用“Router”时,这样写的import { Router, Route, Link } from "react-router-dom";
;
但是用这样就行了,报错解决import { BrowserRouter as Router, Route, Link } from "react-router-dom";