DEV Community

Discussion on: React useState unexpected extra render

Collapse
 
aeryle profile image
Aeryle

The way I see it right now, when your component gets mounted it will log Example and it will also log it when updating the state. Your component gets mounted once and your state is updated once. Makes it log twice.