File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
1
/* @flow */
2
2
3
- import { PureComponent } from 'react' ;
3
+ import { PureComponent , type ComponentType } from 'react' ;
4
4
import { connect } from 'react-redux' ;
5
5
import type { JSONAPIResource , JSONAPIResourceIdentifier } from 'json-api' ;
6
6
import type { RenderProp } from './Query' ;
7
7
import { selectResources } from './selectors' ;
8
8
9
- type Props = {
9
+ type CommonProps = { |
10
10
children : RenderProp ,
11
11
loading : boolean ,
12
+ | } ;
13
+
14
+ type ConnectedProps = { |
15
+ ...CommonProps ,
12
16
resources : Array < JSONAPIResource >
13
- } ;
17
+ | } ;
18
+
19
+ type Props = { |
20
+ ...CommonProps ,
21
+ resourceIds : Array < JSONAPIResourceIdentifier >
22
+ | } ;
14
23
15
- export class DataSet extends PureComponent < Props > {
24
+ export class DataSet extends PureComponent < ConnectedProps > {
16
25
static defaultProps = {
17
26
loading : false ,
18
27
} ;
@@ -30,4 +39,4 @@ const mapStateToProps = (state, props) => ({
30
39
resources : selectResources ( state , props ) ,
31
40
} ) ;
32
41
33
- export default connect ( mapStateToProps ) ( DataSet ) ;
42
+ export default ( connect ( mapStateToProps ) ( DataSet ) : ComponentType < Props > ) ;
You can’t perform that action at this time.
0 commit comments