File tree 2 files changed +26
-22
lines changed
2 files changed +26
-22
lines changed Original file line number Diff line number Diff line change @@ -78,16 +78,6 @@ export default function createConnect(React) {
78
78
79
79
return function wrapWithConnect ( WrappedComponent ) {
80
80
class Connect extends Component {
81
- static displayName = `Connect(${ getDisplayName ( WrappedComponent ) } )` ;
82
- static WrappedComponent = WrappedComponent ;
83
-
84
- static contextTypes = {
85
- store : storeShape
86
- } ;
87
-
88
- static propTypes = {
89
- store : storeShape
90
- } ;
91
81
92
82
shouldComponentUpdate ( nextProps , nextState ) {
93
83
if ( ! pure ) {
@@ -215,6 +205,17 @@ export default function createConnect(React) {
215
205
) ;
216
206
}
217
207
}
208
+ // adding properties in this way
209
+ // prevents ie8 from breaking
210
+ Connect . displayName = `Connect(${ getDisplayName ( WrappedComponent ) } )` ;
211
+ Connect . WrappedComponent = WrappedComponent ;
212
+
213
+ Connect . contextTypes = {
214
+ store : storeShape
215
+ } ;
216
+ Connect . propTypes = {
217
+ store : storeShape
218
+ } ;
218
219
219
220
if ( process . env . NODE_ENV !== 'production' ) {
220
221
Connect . prototype . componentWillUpdate = function componentWillUpdate ( ) {
Original file line number Diff line number Diff line change @@ -59,18 +59,7 @@ export default function createProvider(React) {
59
59
) ;
60
60
}
61
61
62
- return class Provider extends Component {
63
- static childContextTypes = {
64
- store : storeShape . isRequired
65
- } ;
66
-
67
- static propTypes = {
68
- store : storeShape . isRequired ,
69
- children : ( requireFunctionChild ?
70
- PropTypes . func :
71
- PropTypes . element
72
- ) . isRequired
73
- } ;
62
+ class Provider extends Component {
74
63
75
64
getChildContext ( ) {
76
65
return { store : this . store } ;
@@ -102,5 +91,19 @@ export default function createProvider(React) {
102
91
103
92
return Children . only ( children ) ;
104
93
}
94
+ }
95
+ // adding properties in this way
96
+ // prevents ie8 from breaking
97
+ Provider . childContextTypes = {
98
+ store : storeShape . isRequired
99
+ } ;
100
+
101
+ Provider . propTypes = {
102
+ store : storeShape . isRequired ,
103
+ children : ( requireFunctionChild ?
104
+ PropTypes . func :
105
+ PropTypes . element
106
+ ) . isRequired
105
107
} ;
108
+ return Provider ;
106
109
}
You can’t perform that action at this time.
0 commit comments