Skip to content

Instantly share code, notes, and snippets.

@dannycallaghan
Last active November 11, 2022 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannycallaghan/a1b34b4829374f69b0c1c0adf86f5710 to your computer and use it in GitHub Desktop.
Save dannycallaghan/a1b34b4829374f69b0c1c0adf86f5710 to your computer and use it in GitHub Desktop.
// index.js
<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>
// App.js - notice how Home is nested in Layout
<Routes>
<Route path="/" element={<Layout />}>
<Route path="/" element={<Home />} />
<Route path="/foo" element={<Foo />} />
</Route>
</Routes>
// Layout.js
<>
<Nav />
<Outlet />
</>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment