Module 3 ยท Shipping a portfolio app Lesson 7 of 15
Routing with react-router
Two screens and a shared layout are enough to justify a router. Routes map a URL to a component, and useParams reads the id out of the URL so a detail page can be linked to directly.
Worked example
A route /jobs/:id that reads id and renders the matching job is what makes a link shareable โ which is also what makes it worth putting on a resume.
Your practice task
Add a list page, a detail page and a not-found page, then paste a detail URL into a new tab and make sure it still works.
Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.
Key takeaway
Two screens and a shared layout are enough to justify a router. Routes map a URL to a component, and useParams reads the id out of the URL so a detail page can be linked to directly.
Keep your place in this course
A free account saves which lessons you have finished and unlocks the certificate. The lesson itself stays free to read.
Create free account or sign inCourse complete
You finished every lesson.
Your certificate is ready, and the projects you built are the proof to attach to an application.
Almost there
15 lessons left of 15
Finish every lesson to unlock the certificate. Each one ends in a practice task โ do them and the final project brief writes itself.