Open this example in the interactive library
Source code
"use client";
// components/CatchAllPathList.tsx
import { useParams } from "next/navigation";
export default function CatchAllPathList() {
const { parts } = useParams<{ parts: string[] }>();
return (
<ol>
{(parts ?? []).map((s, i) => (
<li key={i}>{s}</li>
))}
</ol>
);
}
