Skip to content

Commit

Permalink
rename RequiredProps to ComponentProps
Browse files Browse the repository at this point in the history
  • Loading branch information
jeetiss authored and molefrog committed Nov 15, 2023
1 parent 24f6172 commit 6a0da2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/wouter-preact/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export type NavigationalProps<
> = ({ to: Path; href?: never } | { href: Path; to?: never }) &
HookNavigationOptions<H>;

type AsChildProps<RequiredProps, DefaultElementProps> =
| ({ asChild?: false } & RequiredProps & DefaultElementProps)
| ({ asChild: true; children: ComponentChildren } & RequiredProps);
type AsChildProps<ComponentProps, DefaultElementProps> =
| ({ asChild?: false } & ComponentProps & DefaultElementProps)
| ({ asChild: true; children: ComponentChildren } & ComponentProps);

export type LinkProps<H extends BaseLocationHook = BrowserLocationHook> =
AsChildProps<NavigationalProps<H>, JSX.HTMLAttributes>;
Expand Down
6 changes: 3 additions & 3 deletions packages/wouter/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ export function Redirect<H extends BaseLocationHook = BrowserLocationHook>(
context?: any
): ReactElement<any, any> | null;

type AsChildProps<RequiredProps, DefaultElementProps> =
| ({ asChild?: false } & RequiredProps & DefaultElementProps)
| ({ asChild: true; children: React.ReactNode } & RequiredProps);
type AsChildProps<ComponentProps, DefaultElementProps> =
| ({ asChild?: false } & ComponentProps & DefaultElementProps)
| ({ asChild: true; children: React.ReactNode } & ComponentProps);

export type LinkProps<H extends BaseLocationHook = BrowserLocationHook> =
AsChildProps<
Expand Down

0 comments on commit 6a0da2d

Please sign in to comment.