react-router相关
Link
1 | <Link to="/">Home</Link> |
useHistory
1 | let history = useHistory(); |
useParams
1 | let params = useParams(); |
Outlet
index route
1 | <Route index element={<Activity />} /> |
useLocation 获取路由
1 | let location = useLocation(); |
路由权限(新版)
1 | const ProtectedRoute = ({ user, children }) => { |
路由权限
1 | <Route exact path="/home" render={() => ( |