Error AtlasError Documentation and Resolution

Can't perform a React state update on an unmounted component

Can't perform a React state update on an unmounted component.

React detected a state update attempt after a component has been unmounted, indicating a memory leak or async issue.

React error #185runtime
Can't perform a React state update on an unmounted component.
  • An async operation completes after the component unmounts.
  • A subscription or event listener was not cleaned up.
  • setState is called in a stale closure.
  • Timers or intervals were not cleared.
  1. Cancel async operations using AbortController or flags.
  2. Clean up subscriptions in useEffect return functions.
  3. Clear timeouts and intervals on unmount.
  4. Check component mount state before updating.
React Docs: Effects and Lifecycle
React setState on unmounted component: causes and fixes | Error Atlas