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) {
7878
7979 return function wrapWithConnect ( WrappedComponent ) {
8080 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+
9182
9283 shouldComponentUpdate ( nextProps , nextState ) {
9384 if ( ! pure ) {
@@ -215,6 +206,16 @@ export default function createConnect(React) {
215206 ) ;
216207 }
217208 }
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+ } ;
218219
219220 if ( process . env . NODE_ENV !== 'production' ) {
220221 Connect . prototype . componentWillUpdate = function componentWillUpdate ( ) {
Original file line number Diff line number Diff line change @@ -59,18 +59,7 @@ export default function createProvider(React) {
5959 ) ;
6060 }
6161
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 {
7463
7564 getChildContext ( ) {
7665 return { store : this . store } ;
@@ -102,5 +91,17 @@ export default function createProvider(React) {
10291
10392 return Children . only ( children ) ;
10493 }
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
105105 } ;
106+ return Provider ;
106107}
You can’t perform that action at this time.
0 commit comments