Skip to content

Commit

Permalink
Merge pull request #244 from DogusErdem/fix/component-props-intellisense
Browse files Browse the repository at this point in the history
fix: Intellisense problems have been fixed.
  • Loading branch information
KaganYrk authored Oct 16, 2024
2 parents 0c300df + 7673e8a commit 01edb2a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/core/KitraProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,15 @@ export const KitraProvider =
);

export function applyDefaults<T>(Component: ComponentType<T>) {
return React.forwardRef((props: T | any, ref: ForwardedRef<any>) => (
return React.forwardRef<any, T>((props, ref) => (
<TypographyContext.Consumer>
{typography =>
<Component ref={ref} typography={typography?.typography} {...props} />
}
{typography => (
<Component
ref={ref}
typography={typography?.typography}
{...(props as T)}
/>
)}
</TypographyContext.Consumer>
));
}

0 comments on commit 01edb2a

Please sign in to comment.