File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/styled-components/src Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,22 @@ type JSXElementKeys = keyof JSX.IntrinsicElements
66
77const tags = Object . keys ( styled )
88
9+ type SafeIntrinsicComponent < T extends keyof JSX . IntrinsicElements > = (
10+ props : Omit < JSX . IntrinsicElements [ T ] , 'color' > ,
11+ ) => React . ReactElement < any , T >
12+
913export const createX = < TProps extends object > ( generator : StyleGenerator ) => {
1014 type X < TProps extends object > = {
1115 extend < TExtendProps extends object > (
1216 ...generators : StyleGenerator [ ]
1317 ) : X < TExtendProps >
1418 } & {
15- [ Key in JSXElementKeys ] : StyledComponent < Key , DefaultTheme , TProps , never >
19+ [ Key in JSXElementKeys ] : StyledComponent <
20+ SafeIntrinsicComponent < Key > ,
21+ DefaultTheme ,
22+ TProps ,
23+ 'color'
24+ >
1625 }
1726
1827 // @ts -ignore
You can’t perform that action at this time.
0 commit comments