Contacts
Book
Review of NextJS router
- Understand how routes are setup from
/app/pages.js
- Created custom 404 page with
app/not-found.jsx
and setup nav/aside in app/layout.js
- Nested routes are created as folders/subfolders within the app directory.
- Navigation between pages is implemented using the
Link
component. - Dynamic routes are created as subfolders with square brackets e.g.
contacts/[id]
- Dynamic parameters can be extracted using
useParams()
hook for client components orconst param = await params;
and const id = param.id;
for server components. - Learnt the hard way that server components can't pull data from client localForage cache.