Skip to content

Latest commit

 

History

History
53 lines (45 loc) · 1.38 KB

NOTES.md

File metadata and controls

53 lines (45 loc) · 1.38 KB

/bakery => /bakery/ => /bakery/not-found => Error! /bakery/cookies => /bakery/muffins =>

const USERS_PATH = '/users';
const USER_PATH = '/users/:userId';

let routes = createRoutesFromArray([
  {
    path: USERS_PATH,
    element: <Users />,
    children: [
      {
        path: USER_PATH,
        element: <UserProfile />
      }
    ]
  }
])

<Routes>
  <Route path="/bakery" element={<BakeryHome />}>
    <Route path="/" element={<Index />} />
    <Route path="*" element={<NotFound />}>

    <Route element={<Layout />}>
      <Route path="cookies" element={<Cookies />} />
      <Route path="/cinnamon-rolls" element={<CinnamonRolls />} />
    </Route>

    <Route path="muffins" element={<Muffins />} />
    <Route path="/cupcakes" element={<Cupcakes />} />
  </Route>
</Routes>

<Routes>
  <Route path="/bakery" element={<BakeryHome />}>
    <Route index element={<Index />} />
    <Route path="*" element={<NotFound />}>

    <Route element={<Layout />}>
      <Route path="cookies" element={<Cookies />} />
      <Route path="/bakery/cinnamon-rolls" element={<CinnamonRolls />} />
    </Route>

    <Route path="muffins" element={<Muffins />} />
    <Route path="/bakery/cupcakes" element={<Cupcakes />} />
  </Route>
</Routes>