Skip to content

Commit

Permalink
fix: issue with css prop when using polymorphism
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Aug 11, 2021
1 parent f7bfb06 commit d02d9de
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/react/types/styled-component.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export interface StyledComponent<
As extends ''
? { as: keyof JSX.IntrinsicElements }
: As extends React.ComponentType<infer P>
? Util.Assign<P, TransformedProps & { as: As }>
? Util.Assign<P, TransformedProps & { as: As, css?: CSS }>
: As extends keyof JSX.IntrinsicElements
? Util.Assign<JSX.IntrinsicElements[As], TransformedProps & { as: As }>
? Util.Assign<JSX.IntrinsicElements[As], TransformedProps & { as: As, css?: CSS }>
: never
)
): React.ReactElement | null
Expand All @@ -37,10 +37,6 @@ export interface StyledComponent<
[$$StyledComponentMedia]: Media
}

type InferLate<CSS extends {} = {}, Props extends {} = {}> = {
[K in keyof Props]: K extends 'css' ? CSS : unknown
}

/** Returns a new CSS Component. */
export interface CssComponent<
Type = 'span',
Expand Down

0 comments on commit d02d9de

Please sign in to comment.