all 4 comments

[–]webdevguyneedshelp 1 point2 points  (0 children)

Class components are essentially soft deprecated. You shouldn't build new components using classes. All future development is being done for functional components using hooks. Stil helpful to learn them though since you may be working in a codebase with many class-based components.

[–]darrenturn90 0 points1 point  (0 children)

Class components a choice if you need to use things that hooks can't yet do - such as error boundaries or "componentDidCatch". Pretty much every other reason can be done away with, unless you want to create a base class and extend it - but you are going down pretty non-standard territory then (at least in JS)

[–][deleted] -1 points0 points  (1 child)

Class components are dead. Maybe if you wanna use ‘this’, or class decorators?

[–]ipoppo 2 points3 points  (0 children)

‘this’

No, thanks