-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Closed
Description
If you know how to fix the issue, make a pull request instead.
- I tried using the
@types/reactpackage and had problems. - I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
- I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
- Mention the authors (see
Definitions by:inindex.d.ts) so they can respond.- Authors: @acdlite @sebmarkbage @gaearon
If you do not mention the authors the issue will be ignored.
now:
type EffectCallback = () => (void | (() => void));Can we change it to:
type EffectCallback = () => (void | (() => void) | Promise<void> | Promise<()=>void>);This will help to write a callback in the form of an async function.
useEffect(async ()=>{
const response = await fetchSomeThing('/foo/bar')
setState(response.data.results);
}, []);JX-Zhuang and noahtallenCryrivers, kulak, emilioriosvz, krzkaczor, JX-Zhuang and 2 more
Metadata
Metadata
Assignees
Labels
No labels