Does class components and their lifecycle methods hold any importance presently?
Should I study them for interview or functional components and hooks are enough?
You should know class components & all lifecycle methods and their alternative in hooks, functional components + hooks are important as well.
Reason: My codebases or some part of codebases are still written using class. So, companies sometime ask those question too. Be ready for any question, you don't know what companies are using under the hood.
I'm a full-stack Software Engineer and Architect. I specialise in front-end niceness, but my daily tasks are mostly about making server less work well and scale within our suit of micro services!
You should know class-based components - but I would pretty much avoid using them in almost all cases for new code. The only time I know of to use them is without a choice - when you need to implement an Error boundary - the react docs still specify the API as a class component.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Does class components and their lifecycle methods hold any importance presently?
Should I study them for interview or functional components and hooks are enough?
You should know class components & all lifecycle methods and their alternative in hooks, functional components + hooks are important as well.
Reason: My codebases or some part of codebases are still written using class. So, companies sometime ask those question too. Be ready for any question, you don't know what companies are using under the hood.
Cheers :)
thanks
You should know class-based components - but I would pretty much avoid using them in almost all cases for new code. The only time I know of to use them is without a choice - when you need to implement an Error boundary - the react docs still specify the API as a class component.