React Class Components vs Function Components

Viewed 52

so I'm kinda into React and I've been using both function and class components and I was wondering, what's the true difference between them? When should you use either of them? Are hooks more powerful and effective than class methods? Any answers would be appreciated, thanks!

1 Answers

To be honest, the fact that matters is the project. If project is big, I would rather go with class, because it's already used a lot and easy to find bugs, but hooks are really nice way to optimize code. it takes less space, but I had a moment when I could't get rid of a bug, so I had to change it to class component.

Related