> ## 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-effect-sets-state-every-render

> An effect with no dependency array sets state to a new value on every run, so the component re-renders forever.

## What it flags

A `useEffect` or `useLayoutEffect` with no dependency array sets state to a new object, array or computed value on every run, so the component re-renders without end. Setting a constant such as `true` is not reported, because React bails out when the value is unchanged.

## Configuration

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

```json theme={null}
{
  "rules": { "react-effect-sets-state-every-render": "off" }
}
```


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