Caught
Segments captured from deeply/nested/path/that/keeps/going.
Tip
props.params.slug may arrive as a string (with / separators) or as an array depending on the renderer — always guard with Array.isArray(raw) before iterating.
Raw props.params
| param | value |
|---|---|
| slug | "deeply/nested/path/that/keeps/going" |
Segments (6)
- deeply
- nested
- path
- that
- keeps
- going
// props.params.slug holds every segment after the prefix,
// joined by "/" — split it to get an array.
export default function Page(props: PageProps): any {
const raw = props.params.slug;
const segments = Array.isArray(raw)
? raw
: String(raw).split("/").filter(Boolean);
return (
<ol>
{segments.map((s) => <li>{s}</li>)}
</ol>
);
}