Skip to content

Commit 590f262

Browse files
committed
set title at level 2
1 parent 52f912b commit 590f262

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/NextJs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This creates a project with the following folder structure:
3131
|-------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
3232
| ![ Next Admin folder structure with Pages Router ]( ./img/next-admin-with-page-router-folder-structure.png ) | ![ Next Admin folder structure with App Router ]( ./img/next-admin-with-app-router-folder-structure.png ) |
3333

34-
### Adding React-Admin Dependencies
34+
## Adding React-Admin Dependencies
3535

3636
Add the `react-admin` npm package, as well as a data provider package. In this example, we'll use `ra-data-json-server` to connect to a test API provided by [JSONPlaceholder](https://jsonplaceholder.typicode.com).
3737

@@ -40,7 +40,7 @@ cd next-admin
4040
yarn add react-admin ra-data-json-server
4141
```
4242

43-
### Creating The Admin App Component
43+
## Creating The Admin App Component
4444

4545
Next, create a `components` directory inside `src`, and an admin App component in `src/components/AdminApp.jsx`:
4646

@@ -77,7 +77,7 @@ export default AdminApp;
7777

7878
This is a minimal configuration to render CRUD pages for users, posts and comments. React-admin guesses the data structure from the API response.
7979

80-
### Exposing The Admin App Component
80+
## Exposing The Admin App Component
8181
React-admin is designed as a Single-Page Application, rendered on the client-side. It comes with its own routing sytem, which conflicts with the Next.js routing system. So we must prevent Next.js from rendering the react-admin component on the server-side.
8282

8383
To do that, we will have to import our `<AdminApp>` component in Next.js by using the [__lazy loading__ system provided by Next.js](https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading) and specify the [`ssr` option to false](https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#with-no-ssr).
@@ -139,7 +139,7 @@ Now the admin renders at `http://localhost:3000/admin`, and you can use the Next
139139

140140
**Tip**: If you migrated from the Pages Router, you might have to delete the `.next` directory in your project to ensure NextJS bundles the client dependencies correctly.
141141

142-
### Adding an API
142+
## Adding an API
143143

144144
[Next.js allows to serve an API](https://nextjs.org/docs/api-routes/introduction) from the same server. You *could* use this to build a CRUD API by hand. However, we consider that building a CRUD API on top of a relational database is a solved problem and that developers shouldn't spend time reimplementing it.
145145

0 commit comments

Comments
 (0)