DEV Community

Discussion on: React 18 - Avoiding Use Effect Getting Called Twice

Collapse
 
sunil_prasad1 profile image
Sunil Prasad

This happens only in development mode not in production mode . So should we change the code to handle behaviour only for the development mode.

Collapse
 
ecyrbe profile image
ecyrbe • Edited

No, this can happen in production. It's just that they do it on purpose on dev. But in production, it can happen. They did not activate this on dev just to piss devs off.