This is a demo repo for the front end CoP talk of the same name.
This demo can be run locally so you can play with it yourself.
I've set up a little API that serves some data so we can play with fetching data in various places.
To start it, run the following command in the root directory:
npm run start:api
To run the app that makes up the front end (such as it is), run:
npm run dev
In Next.js app router, components are server components by default.
To declare a client component use, this declaration at the top of the component file:
use client;
This declares a network boundary - once a client component has been declared, you can't import and user a server component. However, you can pass a server component as a prop and display it that way.
- Data fetching
- Managing user state