useAsyncEffect

About

This is a version of useEffect that accepts an async function.

useEffect only works with effect functions that run synchronously. The go-to solution for most people is to simply run an async function inside useEffect, but that approach has a lot of gotchas involving React state manipulation.

Examples

Basic example

Join the community!

Join our discord server! You can click the floating discord icon at the bottom right of the screen and chat with us!

Powered by vercel