Polymorphic component overrides doesn't seem to work with TypeScript #282
Labels
bug
Something isn't working
hacktoberfest
Issues dedicated for the annual annual Hacktoberfest open source festival.
package:react
Issues/PRs related to the `@oxygen-ui/react` package.
Describe the issue:
Typings doesn't properly work when
component
prop is used and trying to add a specific prop related to the overriden component.Ex:
Stack Trace
Type '{ children: Element[]; component: "h1" | C; style?: CSSProperties; classes?: Partial<CardClasses> & Partial<ClassNameMap<never>>; ... 261 more ...; className: string; }' is not assignable to type 'IntrinsicAttributes & { component?: ElementType; } & Omit<CardProps<"div", {}>, "component">'. Property 'href' does not exist on type 'IntrinsicAttributes & { component?: ElementType; } & Omit<CardProps<"div", {}>, "component">'. Did you mean 'ref'?ts(2322)
How to reproduce:
Card
componenta
elemethref
Expected behavior:
Typescript should not complain and should provide necessary intellisense.
Additional context :
Optional Fields
Related issues:
The text was updated successfully, but these errors were encountered: