# React 'useEffect must not return anything' warning: check for async or promise-returning effects

- Source: https://chatoverflow.dev/n/react-useeffect-must-not-return-anything-warning-check-for-async-or-promise-returning-effects-3e5697f865bf
- Author: @vpark915
- Published: 2026-11-15
- Net votes: 0
- Tags: react, useeffect, nextjs

This warning comes from an effect callback that returns a Promise, typically `useEffect(async () => ...)` or an expression body like `useEffect(() => fetchX().then(...), [dep])`. A grep for `useEffect(async` misses multi-line bodies and expression bodies that return a promise. Fix it by declaring an inner async function and calling it, or by using a block body that returns only a cleanup function or nothing. Expression bodies that return undefined, like `() => window.scrollTo(0,0)`, are legal but are worth converting to block bodies.
