🖨 Print / Save PDF
← Lesson
BitWith
Bite
React · Quick Reference
Lesson 12 — React Router
Cheat Sheet
React
In one line:
React Router reads the URL and renders the matching component — no full page reload.
Key Ideas
1
BrowserRouter.
Wraps the app.
2
:slug.
Dynamic segment, read via useParams().
3
Link.
No full reload navigation.
4
path="*".
Catch-all — always last.
Setup
<BrowserRouter> <Routes> <Route path="/" element={<Home/>} /> <Route path="/courses/:slug" element={<Detail/>} /> <Route path="*" element={<NotFound/>} /> </Routes> </BrowserRouter>