We want to be able to conditionally render out components based on the URL.
- Still rendering a single page application
- React Router gives us different components to use
BrowserRouter
- We use once at a high level - controls all the routing for it's childrenRoute
- conditionally renders somethingLink
- changes the path and causes a re-render of any components that need to - won't actually make another get requestSwitch
- When the path is
/students/new
, we should see the form to create a new student - When the path is
/students/2
, we should see a student detail component that renders out an h2 of the student's first and last name for the second student - When the path is
/students/7
, we should see a student detail component that renders out an h2 of the student's first and last name for the seventh student
- Each student show component should have a button that says 'delete this student'
- When we click it, we should delete that student from the database and then redirect them to '/students'