File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { fr } from "./fr";
33import { cx } from "./tools/cx" ;
44import { assert } from "tsafe/assert" ;
55import { is } from "tsafe/is" ;
6+ import type { UnpackProps } from "./tools/UnpackProps" ;
67
78type HTMLAnchorProps = DetailedHTMLProps <
89 AnchorHTMLAttributes < HTMLAnchorElement > ,
@@ -12,10 +13,8 @@ type HTMLAnchorProps = DetailedHTMLProps<
1213// eslint-disable-next-line @typescript-eslint/no-empty-interface
1314export interface RegisterLink { }
1415
15- export type RegisteredLinkProps = RegisterLink extends {
16- Link : ( props : infer LinkProps ) => any ;
17- }
18- ? Omit < LinkProps , "children" >
16+ export type RegisteredLinkProps = RegisterLink extends { Link : infer Link }
17+ ? Omit < UnpackProps < Link > , "children" >
1918 : Omit < HTMLAnchorProps , "children" > ;
2019
2120let Link : (
Original file line number Diff line number Diff line change 1+ export type UnpackProps < T > = T extends React . ComponentType < infer P > ? P : never ;
You can’t perform that action at this time.
0 commit comments