You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/docs/content/docs/troubleshooting.mdx
+3-2
Original file line number
Diff line number
Diff line change
@@ -51,8 +51,7 @@ from Next.js:
51
51
Missing Suspense boundary with useSearchParams
52
52
```
53
53
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):
56
55
57
56
```tsx
58
57
'use client'
@@ -71,6 +70,8 @@ function Client() {
71
70
}
72
71
```
73
72
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
+
74
75
The recommended approach is:
75
76
76
77
1. Keep page.tsx as a server component (no `'use client'{:ts}` directive)
0 commit comments