Files
Zack TannerandGitHub b914ad8192 fix interception route rewrite regex not supporting hyphenated segments (#64805)
The function we use to generate a string with named parameters to pass
into `path-to-regexp` currently doesn't properly handle non-word
characters (namely, for the purposes of this bugfix, hyphens). As a
result, `pathToRegexp` will convert something like `/foo/:bar-baz` into
`/^\/foo(?:\/([^\/#\?]+?))-baz[\/#\?]?$/i`, effectively only treating
the `:foo` as part of the regex capture group and leaving a dangling
-baz.

This means using an interception route within a dynamic segment (such as
`/foo/[bar-baz]`) would not properly trigger the route interception

Fixes #64766
2024-04-19 18:11:32 -06:00

10 lines
200 B
TypeScript

import Link from 'next/link'
export default function Page() {
return (
<Link href="/interception-route-special-params/some-random-param/some-page">
Trigger Interception
</Link>
)
}