Skip to content

Commit

Permalink
Fix issue with router final example
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylagordon committed Feb 6, 2024
1 parent e6c8a6e commit 3b12e1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lessons/module-3/react-router-v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ You would use this approach when you have distinct pages or components that shou
```jsx
import './App.css';
import './App.css';
import { Routes, Route, NavLink } from 'react-router-dom';
import Home from '../Home/Home';
import Creatures from '../Creatures/Creatures';
Expand All @@ -633,8 +634,9 @@ function App() {
</nav>
<h1>Puppies or Sharks?</h1>
<Routes>
<Route path="/" element={<Home />}/>
<Route path="/:animal/:id" element={<Creatures />}>
<Route path="/" element={<Home />} />
<Route path=":animal" element={<Creatures />} />
<Route path="/:animal/:id" element={<CreatureDetails />} />
</Routes>
</main>
);
Expand Down

0 comments on commit 3b12e1b

Please sign in to comment.