File tree 3 files changed +14
-8
lines changed 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change
1
+ import createReduxShape from './createReduxShape' ;
1
2
import identity from '../utils/identity' ;
2
3
import shallowEqual from '../utils/shallowEqual' ;
3
4
import isPlainObject from '../utils/isPlainObject' ;
@@ -8,7 +9,7 @@ export default function createConnector(React) {
8
9
9
10
return class Connector extends Component {
10
11
static contextTypes = {
11
- redux : PropTypes . object . isRequired
12
+ redux : createReduxShape ( PropTypes ) . isRequired
12
13
} ;
13
14
14
15
static propTypes = {
Original file line number Diff line number Diff line change
1
+ import createReduxShape from './createReduxShape' ;
2
+
1
3
export default function createProvider ( React ) {
2
4
const { Component, PropTypes } = React ;
3
5
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 ;
9
7
10
8
return class Provider extends Component {
11
9
static propTypes = {
12
- redux : reduxShape . isRequired ,
10
+ redux : reduxShapeIsRequired ,
13
11
children : PropTypes . func . isRequired
14
12
} ;
15
13
16
14
static childContextTypes = {
17
- redux : reduxShape . isRequired
15
+ redux : reduxShapeIsRequired
18
16
} ;
19
17
20
18
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