DEV Community

Discussion on: Are you taking care of memory leaks with the useEffect hook?

Collapse
 
king11 profile image
Lakshya Singh

I feel like hooks are more peformant because we can specify for particular dependencies they need to observe as compared to class functions . I don't know if am right 😅 just a react noobie

Collapse
 
napoleon039 profile image
Nihar Raote

I'm far from anything resembling an expert. I consider myself a React noobie as well 😂. And I like that about Hooks too.

When I started learning React and came across state changes using setState, I thought it was a hassle but later got used to it. When I saw how Hooks worked, I just stopped using class components completely. I don't think I've ever used class components in the last month.

I have no idea about the performance factor though. I think I read somewhere that the performance is not that different, and it depends on how we use it. But I could be remembering wrongly. I hope someone corrects or confirms this here.

If there is a performance difference, I might write an article on it.