From 674616b09f10857ac8844658e0c769c7dd58088c Mon Sep 17 00:00:00 2001 From: Heather Faerber Date: Thu, 24 Oct 2024 08:42:39 -1000 Subject: [PATCH] Reformat dropdowns and comment out router prework --- module3/lessons/react-router.md | 56 ++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/module3/lessons/react-router.md b/module3/lessons/react-router.md index a1a76459..ac0f208c 100644 --- a/module3/lessons/react-router.md +++ b/module3/lessons/react-router.md @@ -20,7 +20,8 @@ module: 3 * `Outlet` A component that renders the next match in a set of matches. it must exist in the parent component when nesting routes * `useParams` A hook that allows us to gain access to a Route's params -
+ + ## Why Routing? **Routing** refers to keeping a webpage up to date with the current url, and vice-versa. Most of the apps you've written so far have been single-page applications. One HTML page whose content is updated through user interactions and JS. These DO NOT use routing. They work fine, but put some limits on the user experience of our applications. -
+ + +
-## Exercise # 1: Render Puppies +## Rendering Puppies Your goal is click on the word Puppies and see a grid of 9 puppies on the DOM. The page should look something like the picture on the lesson plan. ***While you may change components*** as needed, you shouldn't outright delete content from the page to achieve this. -
+ ### Take 10 minutes in pairs to get the puppies rendering #### Hints: @@ -156,7 +160,7 @@ Your goal is click on the word Puppies and see a grid of 9 puppies on the DOM. T - What additional react-router components should you use? Do any current components need to change? - How do you pass props into a component rendered by a `` ? -
+ -
+ -
+ +
+ ## Rendering the Sharks -
+ +
+ ## Dynamic Routing In this exercise, we'll explore two ways to achieve dynamic routing in order to obtain an animal and its ID from the route: first, we'll use the `Outlet`, and then we'll show you how to implement a dynamic route without using an outlet. -
+ -
+ -
+ -
+ +
+ ## Rendering the CreatureDetails component -
+ -
+ -
+ -
+