InterviewBuddy
All interview questions

Why can an effect run twice during development?

Intermediate

Answer

React Strict Mode may run an extra setup and cleanup cycle to reveal missing cleanup. Make the effect safe to start and stop rather than relying on it running exactly once.