react-router-dom v6

·  阅读 62
  • https://reacttraining.com/blog/react-router-v6-pre/
<BrowserRouter>
  <Routes>
    <Route path="/" element={<Home />} />
    <Route path="users" element={<Users />}>
      <Route path="/" element={<UsersIndex />} />
      <Route path=":id" element={<UserProfile />} />
      <Route path="me" element={<OwnUserProfile />} />
    </Route>
  </Routes>
</BrowserRouter>
复制代码
分类:
前端
标签: