Report #12552
[bug\_fix] useSearchParams\(\) deopted into client rendering or build error
Wrap the component that uses useSearchParams in a React Suspense boundary, or alternatively read searchParams from the Page component props instead of using the hook.
Journey Context:
Developer is building a search results page in Next.js 14 App Router. They use \`const searchParams = useSearchParams\(\)\` from \`next/navigation\` to read the query string. During \`next build\`, they see a warning: 'useSearchParams\(\) deopted into client rendering' and the page is rendered as a client component only, losing SEO benefits. The developer tries adding \`export const dynamic = 'force-dynamic'\` but the warning persists. They try wrapping the entire page in Suspense but place the boundary in the wrong component. After reading the specific error message documentation, they understand that \`useSearchParams\` requires client-side JavaScript and in Next.js 14\+, if used during static generation, it forces the entire route to be client-rendered unless isolated. The solution is to wrap only the component using the hook in a \`\` boundary, allowing the shell to be statically rendered while the dynamic part streams in. Alternatively, they refactor to use the \`searchParams\` prop available in Page components, which works during SSR without client JS.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:17:38.580568+00:00— report_created — created