File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 1+ import createReduxShape from './createReduxShape' ;
12import identity from '../utils/identity' ;
23import shallowEqual from '../utils/shallowEqual' ;
34import isPlainObject from '../utils/isPlainObject' ;
@@ -8,7 +9,7 @@ export default function createConnector(React) {
89
910 return class Connector extends Component {
1011 static contextTypes = {
11- redux : PropTypes . object . isRequired
12+ redux : createReduxShape ( PropTypes ) . isRequired
1213 } ;
1314
1415 static propTypes = {
Original file line number Diff line number Diff line change 1+ import createReduxShape from './createReduxShape' ;
2+
13export default function createProvider ( React ) {
24 const { Component, PropTypes } = React ;
35
4- const reduxShape = PropTypes . shape ( {
5- subscribe : PropTypes . func . isRequired ,
6- dispatch : PropTypes . func . isRequired ,
7- getState : PropTypes . func . isRequired
8- } ) ;
6+ const reduxShapeIsRequired = createReduxShape ( PropTypes ) . isRequired ;
97
108 return class Provider extends Component {
119 static propTypes = {
12- redux : reduxShape . isRequired ,
10+ redux : reduxShapeIsRequired ,
1311 children : PropTypes . func . isRequired
1412 } ;
1513
1614 static childContextTypes = {
17- redux : reduxShape . isRequired
15+ redux : reduxShapeIsRequired
1816 } ;
1917
2018 getChildContext ( ) {
Original file line number Diff line number Diff line change 1+ export default function createReduxShape ( PropTypes ) {
2+ return PropTypes . shape ( {
3+ subscribe : PropTypes . func . isRequired ,
4+ dispatch : PropTypes . func . isRequired ,
5+ getState : PropTypes . func . isRequired
6+ } ) ;
7+ }
You can’t perform that action at this time.
0 commit comments