File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -56,21 +56,23 @@ type ReactClassPropKeys = keyof React.ClassAttributes<any>
5656export interface CreateStyledComponentBase <
5757 InnerProps ,
5858 ExtraProps ,
59- Theme extends object
59+ StyledInstanceTheme extends object
6060> {
6161 <
6262 StyleProps extends Omit <
6363 Overwrapped < InnerProps , StyleProps > ,
6464 ReactClassPropKeys
65- > = Omit < InnerProps & ExtraProps , ReactClassPropKeys >
65+ > = Omit < InnerProps & ExtraProps , ReactClassPropKeys > ,
66+ Theme extends object = StyledInstanceTheme
6667 > (
6768 ...styles : Array < Interpolation < WithTheme < StyleProps , Theme > > >
6869 ) : StyledComponent < InnerProps , StyleProps , Theme >
6970 <
7071 StyleProps extends Omit <
7172 Overwrapped < InnerProps , StyleProps > ,
7273 ReactClassPropKeys
73- > = Omit < InnerProps & ExtraProps , ReactClassPropKeys >
74+ > = Omit < InnerProps & ExtraProps , ReactClassPropKeys > ,
75+ Theme extends object = StyledInstanceTheme
7476 > (
7577 template : TemplateStringsArray ,
7678 ...styles : Array < Interpolation < WithTheme < StyleProps , Theme > > >
Original file line number Diff line number Diff line change @@ -8,3 +8,14 @@ styled.body
88styled . div
99// $ExpectType CreateStyledComponentIntrinsic<"svg", {}, any>
1010styled . svg
11+
12+ {
13+ // $ExpectType CreateStyledComponentIntrinsic<"svg", { bar: string }, { themed: "black" }>
14+ styled . div < { bar : string } , { themed : 'black' } > `
15+ color: ${ props => {
16+ // $ExpectType { themed: "black" }
17+ const { theme } = props
18+ return theme . themed
19+ } } ;
20+ `
21+ }
You can’t perform that action at this time.
0 commit comments