@@ -29,7 +29,13 @@ function createEmotionStyled(emotion: Emotion, view: ReactType) {
29
29
staticClassName = options . e
30
30
identifierName = options . label
31
31
stableClassName = options . target
32
- shouldForwardProp = options . shouldForwardProp
32
+ shouldForwardProp =
33
+ tag . __emotion_forwardProp && options . shouldForwardProp
34
+ ? propName =>
35
+ tag . __emotion_forwardProp ( propName ) &&
36
+ // $FlowFixMe
37
+ options . shouldForwardProp ( propName )
38
+ : options . shouldForwardProp
33
39
}
34
40
const isReal = tag . __emotion_real === tag
35
41
const baseTag =
@@ -75,6 +81,7 @@ function createEmotionStyled(emotion: Emotion, view: ReactType) {
75
81
static __emotion_styles : Interpolations
76
82
static __emotion_base : Styled
77
83
static __emotion_target : string
84
+ static __emotion_forwardProp : void | ( string => boolean )
78
85
static withComponent : ( ElementType , options ? : StyledOptions ) = > any
79
86
80
87
componentWillMount ( ) {
@@ -148,6 +155,7 @@ function createEmotionStyled(emotion: Emotion, view: ReactType) {
148
155
Styled . __emotion_styles = styles
149
156
Styled . __emotion_base = baseTag
150
157
Styled . __emotion_real = Styled
158
+ Styled . __emotion_forwardProp = shouldForwardProp
151
159
Object . defineProperty ( Styled , 'toString' , {
152
160
enumerable : false ,
153
161
value ( ) {
0 commit comments