Skip to content

Commit

Permalink
format and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnyVerduijn committed Oct 12, 2024
1 parent 97e4f68 commit 814bec4
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type React from 'react';

type ExtendedProps<Props = {}, OverrideProps = {}> = OverrideProps &
Omit<Props, keyof OverrideProps>;

Expand All @@ -18,16 +20,16 @@ export type PolymorphicRef<C> = C extends React.ElementType
? React.ComponentPropsWithRef<C>['ref']
: never;

export type PolymorphicComponentProps<C, Props = {}> = C extends React.ElementType
? InheritedProps<C, Props & ComponentProp<C>> & {
export type PolymorphicComponentProps<C, Props = {}> = C extends React.ElementType
? InheritedProps<C, Props & ComponentProp<C>> & {
ref?: PolymorphicRef<C>;
renderRoot?: (props: any) => any;
}
: Props extends Record<string, unknown>
? Props & FallbackProps
: FallbackProps;
type FallbackProps = {
: Props extends Record<string, unknown>
? Props & PolymorphicProps
: PolymorphicProps;

type PolymorphicProps = {
component: React.ElementType;
renderRoot?: (props: Record<string, any>) => any;
};
Expand Down

0 comments on commit 814bec4

Please sign in to comment.