2

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!

hradutiu
  • 37
  • 1
  • 3

1 Answers1

0

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.

Eleniko
  • 96
  • 10