Functions
useSearchParams
Client hook for reading the URL query. In an App Router-only project it yields a read-only query interface; get returns the first value or null and getAll returns repeated values. In mixed-router projects the return can be null. A statically rendered page needs a Suspense boundary around the consumer for production builds. Source: https://nextjs.org/docs/app/api-reference/functions/use-search-params. Documentation-reviewed illustrative draft; exact package and execution not verified.
Formal Syntax & Structure
nextjs syntaxnextjs
import { useSearchParams } from "next/navigation"Working Example
Example Snippetnextjs
'use client';import { useSearchParams } from 'next/navigation';export default function Tags() { const query = useSearchParams(); return <p>{query?.getAll('tag').join(', ') ?? ''}</p>;}// Render Tags inside a Suspense boundary in its parent static Page.