@@ -4,33 +4,6 @@ import PropTypes from 'prop-types'
4
4
import createAsyncContext from './createAsyncContext'
5
5
6
6
class AsyncComponentProvider extends React . Component {
7
- static propTypes = {
8
- children : PropTypes . node . isRequired ,
9
- asyncContext : PropTypes . shape ( {
10
- getNextId : PropTypes . func . isRequired ,
11
- resolved : PropTypes . func . isRequired ,
12
- getState : PropTypes . func . isRequired ,
13
- } ) ,
14
- rehydrateState : PropTypes . shape ( {
15
- resolved : PropTypes . object ,
16
- } ) ,
17
- }
18
-
19
- static defaultProps = {
20
- asyncContext : undefined ,
21
- rehydrateState : {
22
- resolved : { } ,
23
- } ,
24
- }
25
-
26
- static childContextTypes = {
27
- asyncComponents : PropTypes . shape ( {
28
- getNextId : PropTypes . func . isRequired ,
29
- resolved : PropTypes . func . isRequired ,
30
- shouldRehydrate : PropTypes . func . isRequired ,
31
- } ) . isRequired ,
32
- }
33
-
34
7
componentWillMount ( ) {
35
8
this . asyncContext = this . props . asyncContext || createAsyncContext ( )
36
9
this . rehydrateState = this . props . rehydrateState
@@ -55,4 +28,31 @@ class AsyncComponentProvider extends React.Component {
55
28
}
56
29
}
57
30
31
+ AsyncComponentProvider . propTypes = {
32
+ children : PropTypes . node . isRequired ,
33
+ asyncContext : PropTypes . shape ( {
34
+ getNextId : PropTypes . func . isRequired ,
35
+ resolved : PropTypes . func . isRequired ,
36
+ getState : PropTypes . func . isRequired ,
37
+ } ) ,
38
+ rehydrateState : PropTypes . shape ( {
39
+ resolved : PropTypes . object ,
40
+ } ) ,
41
+ }
42
+
43
+ AsyncComponentProvider . defaultProps = {
44
+ asyncContext : undefined ,
45
+ rehydrateState : {
46
+ resolved : { } ,
47
+ } ,
48
+ }
49
+
50
+ AsyncComponentProvider . childContextTypes = {
51
+ asyncComponents : PropTypes . shape ( {
52
+ getNextId : PropTypes . func . isRequired ,
53
+ resolved : PropTypes . func . isRequired ,
54
+ shouldRehydrate : PropTypes . func . isRequired ,
55
+ } ) . isRequired ,
56
+ }
57
+
58
58
export default AsyncComponentProvider
0 commit comments