@@ -8,7 +8,7 @@ Here's a summary of the breaking changes in `nuqs@2.0.0`:
8
8
- [ Enable support for other React frameworks] ( #adapters )
9
9
- [ ESM-only package] ( #esm-only )
10
10
- [ Deprecated exports have been removed] ( #deprecated-exports )
11
- - [ Renamed ` nuqs/parsers ` to ` nuqs/server ` ] ( #renamed-nuqs-parsers- to-nuqs-server )
11
+ - [ Renamed ` nuqs/parsers ` to ` nuqs/server ` ] ( #renamed-nuqsparsers- to-nuqsserver )
12
12
- [ Debug printout detection] ( #debug-printout-detection )
13
13
14
14
## Adapters
@@ -39,8 +39,7 @@ See #423 for context and a table of supported versions.
39
39
40
40
#### App router
41
41
42
- ``` tsx
43
- // src/app/layout.tsx
42
+ ``` tsx {1} /NuqsAdapter/ title="src/app/layout.tsx"
44
43
import { NuqsAdapter } from ' nuqs/adapters/next/app'
45
44
import { type ReactNode } from ' react'
46
45
@@ -61,8 +60,7 @@ export default function RootLayout({
61
60
62
61
#### Pages router
63
62
64
- ``` tsx
65
- // src/pages/_app.tsx
63
+ ``` tsx {2} /NuqsAdapter/ title="src/pages/_app.tsx"
66
64
import type { AppProps } from ' next/app'
67
65
import { NuqsAdapter } from ' nuqs/adapters/next/pages'
68
66
@@ -75,26 +73,20 @@ export default function MyApp({ Component, pageProps }: AppProps) {
75
73
}
76
74
```
77
75
78
- <details >
79
- <summary >
80
-
81
- #### Next.js (unified)
76
+ #### Unified (router-agnostic)
82
77
83
- </summary >
84
-
85
- If your Next.js app uses both the app _ and_ pages routers, you can use
86
- the unified adapter if it needs to be mounted in either routers, at the cost
78
+ If your Next.js app uses ** both the app and pages routers** and the adapter needs
79
+ to be mounted in either, you can use the unified adapter, at the cost
87
80
of a slightly larger bundle size (~ 100B).
88
81
89
82
``` tsx
90
83
import { NuqsAdapter } from ' nuqs/adapters/next'
91
84
```
92
85
93
- </details >
94
86
95
87
### React (with Vite)
96
88
97
- ``` tsx
89
+ ``` tsx /NuqsAdapter/
98
90
import { NuqsAdapter } from ' nuqs/adapters/react'
99
91
100
92
createRoot (document .getElementById (' root' )! ).render (
0 commit comments