mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What? Interception route rewrites are not properly parsing catch-all segments, which leads to "missing parameter name" errors when passed to `pathToRegexp`. ### Why? The existing `toPathToRegexpPath` function ignores `...` and keeps it as part of the regexp path. This means `pathToRegexp` will attempt to handle `/foo/bar/:...baz` and `/foo/bar/:[...baz]` rather than `/foo/bar/:baz*` ### How? The regex used for matching the path was updated to support the dynamic optional segment, and then we special case catch-all segments Fixes #51784 ---------
16 lines
346 B
TypeScript
16 lines
346 B
TypeScript
import Link from 'next/link'
|
|
|
|
export default function Home() {
|
|
return (
|
|
<>
|
|
<Link href="/intercepting-routes-dynamic-catchall/photos/catchall/123">
|
|
Visit Catch-all
|
|
</Link>
|
|
|
|
<Link href="/intercepting-routes-dynamic-catchall/photos/optional-catchall/123">
|
|
Visit Optional Catch-all
|
|
</Link>
|
|
</>
|
|
)
|
|
}
|