DEV Community

Discussion on: React: Class Component VS Function Component with Hooks

Collapse
 
raulsebastianmihaila profile image
Raul-Sebastian Mihăilă

It seems that in the hooks example you didn't clear the interval. Why is that?

Collapse
 
danielleye profile image
Danielle Ye

Hey Raul, thanks! You are right and it is a good point! I updated the code. It is a valid concern when the app is not server-side rendered.