Hi DEV Community ๐
Making my first post here, and instead of just saying hi, I thought I would ask a question..
As a new learner, is learning class components (vs functional components) a waste of time?
I am using Codecademy as my learning platform - I worked through what I now realise is an older course using classes but found them quite nice to conceptualise and understand. I've moved on to functional components and hooks but I miss using the classes. This feels like an unpopular opinion.
Where do you guys stand on classes vs functions and hooks, going into 2023, especially for a new developer?
Top comments (1)
React is definitely moving towards functional and away from classes.
Classes are a perfectly valid way to work in React, and a lot of the general React concepts that you learned while working with classes will still apply.L, so you certainly havenโt wasted your time.
But you will find that most React projects which are less than a couple of years old, and new projects going forward, use functional components and hooks. Getting familiar with that approach will definitely make it easier for you when joining teams with new and active React projects.