Skip to content

Commit 83dd956

Browse files
committed
allow async functions for CWM, CDM and CWUN
currently a an async hook is a flow error. Yes you can work around by defining a extra method and calling it from the hook, but it's cumbersome.
1 parent 86b9d8b commit 83dd956

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/react.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ declare class React$Component<Props, State = void> {
4444

4545
constructor(props?: Props, context?: any): void;
4646
render(): React$Node;
47-
componentWillMount(): void;
48-
componentDidMount(): void;
47+
componentWillMount(): void | Promise<void>;
48+
componentDidMount(): void | Promise<void>;
4949
componentWillReceiveProps(
5050
nextProps: Props,
5151
nextContext: any,
@@ -65,7 +65,7 @@ declare class React$Component<Props, State = void> {
6565
prevState: State,
6666
prevContext: any,
6767
): void;
68-
componentWillUnmount(): void;
68+
componentWillUnmount(): void | Promise<void>;
6969

7070
// long tail of other stuff not modeled very well
7171

0 commit comments

Comments
 (0)