Experimental
React hook to run an asynchronous effect whenever the component mounts, cleaning up when it unmounts.
The type of the effect value.
An async generator representing the effect logic.
useAsyncEffect(async function* () { yield someDependency; console.log('Async side effect complete!');}); Copy
useAsyncEffect(async function* () { yield someDependency; console.log('Async side effect complete!');});
React hook to run an asynchronous effect whenever the component mounts, cleaning up when it unmounts.