Skip to content

Commit

Permalink
update type
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcarpenter committed Nov 1, 2024
1 parent 7c25856 commit cbb6952
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/elements/src/react/common/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from 'react';
type Destination = 'sign-in' | 'sign-up';
export interface LinkProps extends Omit<React.HTMLAttributes<HTMLAnchorElement>, 'children'> {
navigate: Destination;
children: React.ReactNode | ((url: string) => React.ReactNode);
children: React.ReactNode | ((props: { url: string }) => React.ReactNode);
}

const paths: Record<Destination, keyof Pick<ClerkOptions, 'signInUrl' | 'signUpUrl'>> = {
Expand All @@ -22,7 +22,7 @@ export function Link({ navigate, children, ...rest }: LinkProps) {
);

if (typeof children === 'function') {
return children(destinationUrl);
return children({ url: destinationUrl });
}

return (
Expand Down

0 comments on commit cbb6952

Please sign in to comment.