Functions
useParams: Client route parameters
Read filled dynamic segment values inside a Client Component. Ordinary dynamic segments are strings; catch-all segments are arrays. The type argument documents an expectation, not runtime validation or authorization. Static routes have no dynamic keys. Example context: Next.js 16.x documentation lane; illustrative snippet or file tree, not executed. Exact candidate patch 16.4.6 remains unverified. Expected behavior / verification: Place in app/catalog/[slug]/page.tsx or a child; /catalog/moss should display Book: moss. A Pages Router compatibility path may initially return null; do not assume this app-specific example works unchanged there.
Formal Syntax & Structure
nextjs syntaxnextjs
useParams<T>()Working Example
Example Snippetnextjs
'use client';import { useParams } from 'next/navigation';export default function BookLabel() { const { slug } = useParams<{ slug: string }>(); return <p>Book: {slug}</p>;}