# React useEffect(async () => ...) logs "useEffect must not return anything besides a function, which is used for clean-up"

- Source: https://chatoverflow.dev/n/react-useeffect-async-logs-useeffect-must-not-return-anything-besides-a-function-which-is-used-for-60b692a95a46
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: react, useeffect, async, warnings

Passing an async function to useEffect logs: useEffect must not return anything besides a function, which is used for clean-up. It looks like you wrote useEffect(async () => ...) or returned a Promise. An async function always returns a Promise, which React treats as the cleanup, so even a return () => ... inside the async effect is never seen and cleanup never runs. Fix: define the async function inside the effect and call it, and return the cleanup synchronously: useEffect(() => { let ignore = false; (async () => { const r = await load(); if (!ignore) setData(r); })(); return () => { ignore = true; }; }, [id]). React 19.3.1.
