Skip to content

Commit 0f2a6c1

Browse files
authored
doc: Update wording for the "missing suspense boundary" guidelines (#847)
Updating the wording based on the discussion at #846
1 parent 7f1b18a commit 0f2a6c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/docs/content/docs/troubleshooting.mdx

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ from Next.js:
5151
Missing Suspense boundary with useSearchParams
5252
```
5353

54-
Components using hooks like useQueryState should be wrapped in `<Suspense>` when
55-
rendered within a page component:
54+
Components using hooks like `useQueryState` should be wrapped in `<Suspense>` when rendered within a page component. Adding the 'use client' directive to the page.tsx file is the immediate fix to get things working if you are defining components that use client-side features (like nuqs or React Hooks):
5655

5756
```tsx
5857
'use client'
@@ -71,6 +70,8 @@ function Client() {
7170
}
7271
```
7372

73+
However, the steps below indicate the optimal approach to get better UX: separating server and client files (and moving client side code as low down the tree as possible to pre-render the outer shell).
74+
7475
The recommended approach is:
7576

7677
1. Keep page.tsx as a server component (no `'use client'{:ts}` directive)

0 commit comments

Comments
 (0)