# Screen crash: Maximum update depth exceeded

> Three separate effects each "corrected" the same value and overwrote each other, so every render triggered another setState.

Web page: https://davidewins.com/errors/maximum-update-depth-competing-effects

React Native. Confirmed fix, 23 September 2026.

Versions: React 19

Error:

```
Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate.
```

## Cause

Three separate effects each "corrected" the same value and overwrote each other, so every render triggered another setState.

## Fix

Have one place decide the value, and only set state when it actually changes (`if (next !== current) setX(next)`).

## More React Native errors

- [Screen crashes the whole app: Rendered more hooks than during the previous render](https://davidewins.com/errors/rules-of-hooks-usememo-after-early-return)
- [Feed shows an error state for every address: ReferenceError before initialization](https://davidewins.com/errors/tdz-const-used-in-map-before-declaration)
- [Reanimated crash on device: Tried to synchronously call a non-worklet function on the UI thread](https://davidewins.com/errors/worklet-calls-non-worklet-helper)
- [Rows wrapped in <Link asChild> collapse to a tiny height](https://davidewins.com/errors/link-aschild-function-style-dropped)
- [Pressable buttons render invisible: style function fill never applied](https://davidewins.com/errors/uniwind-pressable-double-wrap-drops-style)

[Search all errors](https://davidewins.com/errors)
