Skip to content

Commit

Permalink
add deferred type resolution to PropsOf type alias
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnyVerduijn committed Oct 12, 2024
1 parent e0721af commit 126f069
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ type ExtendedProps<Props = {}, OverrideProps = {}> = OverrideProps &

type ElementType = keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>;

type PropsOf<C extends ElementType> = JSX.LibraryManagedAttributes<
C,
React.ComponentPropsWithoutRef<C>
>;
type PropsOf<C extends ElementType> = C extends ElementType
? JSX.LibraryManagedAttributes<C, React.ComponentPropsWithoutRef<C>>
: never;

type ComponentProp<C> = {
component?: C;
Expand Down

0 comments on commit 126f069

Please sign in to comment.