> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# react-async-effect-callback

> An async function is passed to useEffect, so its promise is treated as the cleanup function and its errors go unhandled.

## What it flags

`useEffect(async () => ...)`: the promise the callback returns is treated as the cleanup function, so React warns, nothing is cleaned up and a rejection is unhandled.

## How to review or fix

Declare an async function inside the effect and call it.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "react-async-effect-callback": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.