File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
packages/next/src/server/lib/router-utils
test/e2e/app-dir/typed-routes/app/dashboard Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ export type LinkPropsWithPath<T extends Routes> = LinkRestProps &
373
373
href?: never;
374
374
});
375
375
376
- export type LinkProps<RouteType extends string = string > =
376
+ export type LinkProps<RouteType extends string = Routes > =
377
377
| LinkPropsWithHref<RouteType>
378
378
| (RouteType extends Routes ? LinkPropsWithPath<RouteType> : never);
379
379
@@ -400,7 +400,7 @@ declare module 'next/link' {
400
400
* </Link>
401
401
* \`\`\`
402
402
*/
403
- export default function Link<RouteType extends string = string >(
403
+ export default function Link<RouteType extends string = Routes >(
404
404
props: LinkProps<RouteType> & { children: React.ReactNode }
405
405
): JSX.Element;
406
406
}
Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ export default function DashboardPage(props: PageProps<'/dashboard'>) {
4
4
return (
5
5
< div >
6
6
< p > Dashboard Home</ p >
7
- < Link href = "/shop/" > Settings</ Link >
8
- < Link href = "/about" > About</ Link >
7
+ < Link href = "/shop/testing/hello" > Settings</ Link >
8
+ < Link href = "/blog/hey" > About</ Link >
9
+ < Link path = "/blog/[slug]" params = { { slug : 'hey' } } >
10
+ Hey
11
+ </ Link >
9
12
</ div >
10
13
)
11
14
}
You can’t perform that action at this time.
0 commit comments