- Stage 3 Walk-Through 1:41
- Protect Routes That Require Authentication 5:47
- Smart Redirecting 6:01
- Preserve the User State with Cookies 6:27
- Practice Cookie Manipulation 6:38
- Refactoring: ErrorDisplay Component 4:31
- Refactoring: api Helper Function 9:42
- React Router, Authorization, and Refactoring Recap 3:16
- React Router, Authorization, and Refactoring Review 5 questions
Well done!
You have completed React Router, Authorization, and Refactoring Review!
Quiz Question 1 of 5
Which of the following correctly uses React Router to protect both the /banking
and /deposit
routes?
Choose the correct answer below:
-
A
<Routes> <Route path="protect" element={<PrivateRoute />} /> <Route path="banking" element={<Authenticated />} /> <Route path="deposit" element={<Settings />} /> </Routes>
-
B
<Routes> <Route element={<PrivateRoute />} /> <Route path="banking" element={<Authenticated />} /> <Route path="deposit" element={<Settings />} /> </Routes>
-
C
<Routes> <PrivateRoute> <Route path="banking" element={<Authenticated />} /> <Route path="deposit" element={<Settings />} /> </PrivateRoute> </Routes>
-
D
<Routes> <Route element={<PrivateRoute />}> <Route path="banking" element={<Authenticated />} /> <Route path="deposit" element={<Settings />} /> </Route> </Routes>