/server-components-demo

Exploring React Server Components in Next13

Primary LanguageTypeScript

This is a Next.js project bootstrapped with create-next-app to show how React Servver Components work in the new Next.js 13 App router.

Usage

First, install JSON Server with the following command:

npm install -g json-server

Then add the following script to package.json to watch the data folder:

"scripts": {
    // ...next.js scripts
    "json-server": "json-server --watch --port 4000 ./data/db.json",
  }

Start the development server with the following command:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.