Skip to content

Commit

Permalink
fix(TypeScript): make dynamic element prop compatible with e.g. Style…
Browse files Browse the repository at this point in the history
…d Component elements (#2778)
  • Loading branch information
tujoworker authored Oct 23, 2023
1 parent d0c4c6d commit 8a6b766
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/dnb-eufemia/src/shared/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export type DataAttributeTypes = {
// [property: `data-${string}`]: string
}

export type DynamicElement<P = React.HTMLProps<HTMLElement>> =
| keyof JSX.IntrinsicElements
| React.FunctionComponent<P>
export type DynamicElement<
P = React.DetailedHTMLProps<
React.HTMLAttributes<HTMLElement>,
HTMLElement
>,
> = keyof JSX.IntrinsicElements | React.FunctionComponent<P>

0 comments on commit 8a6b766

Please sign in to comment.