mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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
15 lines
220 B
TypeScript
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>
|
|
)
|
|
}
|