React useEffect Firing Twice in Dev but Once in Production: What's Going On
Your useEffect runs twice in development but exactly once in production β and it's not a bug in your code. React's Strict Mode intentionally double-invokes effects to help you catch subtle issues. Here's what's happening and how to handle it correctly.