-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
This is most evident in React lifecycle methods like componentDidMount which is transforms to an async method. (Currently componentDidMount async function due to #3 )
Regardless of whether it's for React, doesn't seem prudent for this codemod to change the contract of the code. E.g.,
function doesSomethingWithAPromise(): void {
promise.then(doSomething);
}
is being converted to:
async function doesSomethingWithAPromise(): Promise<void> {
await promise;
doSomething();
}
(hypothetically, haven't tested with this particular snippet) Point is that the return type has been changed from void to Promise<void>.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels