File tree Expand file tree Collapse file tree 2 files changed +24
-22
lines changed Expand file tree Collapse file tree 2 files changed +24
-22
lines changed Original file line number Diff line number Diff line change @@ -78,16 +78,7 @@ 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
- } ;
81
+
91
82
92
83
shouldComponentUpdate ( nextProps , nextState ) {
93
84
if ( ! pure ) {
@@ -215,6 +206,16 @@ export default function createConnect(React) {
215
206
) ;
216
207
}
217
208
}
209
+ // to prevent breaking ie8
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,17 @@ export default function createProvider(React) {
102
91
103
92
return Children . only ( children ) ;
104
93
}
94
+ }
95
+ Provider . childContextTypes = {
96
+ store : storeShape . isRequired
97
+ } ;
98
+
99
+ Provider . propTypes = {
100
+ store : storeShape . isRequired ,
101
+ children : ( requireFunctionChild ?
102
+ PropTypes . func :
103
+ PropTypes . element
104
+ ) . isRequired
105
105
} ;
106
+ return Provider ;
106
107
}
You can’t perform that action at this time.
0 commit comments