我使用react-router-dom version 6,但当我使用this.props.history.push('/UserDashboard')时,它不起作用。window.location.reload(false); })我的routes.js文件: import { Navigate } from 'react</em
我需要在两个路径之间进行路由,我安装了npm install react-router (RES-路由器: 6.2.1和router: 5.2.0)。我在网页Error: useRoutes() may be used only in the context of a <Router> component.中说了一个错误,这最终意味着我没有用BrowserRouter代码:index.js
import {BrowserRouter as Router} from "rea