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

15 lines
220 B
TypeScript

export default function Layout({
children,
intercept,
}: {
children: React.ReactNode
intercept: React.ReactNode
}) {
return (
<div>
<div>{children}</div>
<div>{intercept}</div>
</div>
)
}