File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 40
40
"babel-core" : " ^6.25.0" ,
41
41
"babel-loader" : " ^7.1.1" ,
42
42
"babel-runtime" : " ^6.23.0" ,
43
+ "flow-bin" : " ^0.57.3" ,
43
44
"prop-types" : " ^15.5.10" ,
45
+ "react" : " ^16.0.0" ,
44
46
"webpack" : " ^3.3.0"
45
47
},
46
48
"peerDependencies" : {
Original file line number Diff line number Diff line change @@ -16,12 +16,14 @@ type ErrorInfo = {
16
16
type State = {
17
17
error : ?Error ,
18
18
info : ?ErrorInfo ,
19
- } ;
19
+ }
20
20
21
- class ErrorBoundary extends Component {
21
+ class ErrorBoundary extends Component < Props , State > {
22
22
props : Props ;
23
23
state : State ;
24
24
25
+ setState : Function
26
+
25
27
static defaultProps = {
26
28
FallbackComponent : ErrorBoundaryFallbackComponent ,
27
29
} ;
@@ -68,10 +70,10 @@ class ErrorBoundary extends Component {
68
70
69
71
70
72
export const withErrorBoundary : Function = (
71
- Component : * ,
72
- FallbackComponent : * ,
73
+ Component : Class < React . Component < * >> ,
74
+ FallbackComponent : Class < React . Component < * >> ,
73
75
onError : Function
74
- ) : Function => ( props : * ) : * => (
76
+ ) : Function => props => (
75
77
< ErrorBoundary FallbackComponent = { FallbackComponent } onError = { onError } >
76
78
< Component { ...props } />
77
79
</ ErrorBoundary >
You can’t perform that action at this time.
0 commit comments