React Jamming Project : why class components vs functional components?

The React Jamming Project and many of Codecademy’s React projects instruct to use class components, however my understanding is that modern use is to move away from class components in favour of functional components where ever possible.

Is it possible to do this project using functional components, or is there a practical reason for using class components?

Under which circumstances would it be best to choose class versus functional components?

Many thanks for any advice or help :slight_smile:

Hello there!
Maybe the reason for using class components is simply to
practice using them.

Also, I think you can try using anything you want, after you completed the project, once you have a good grasp how the whole thing works. And if your different approaches work as well, then you’ll have multiple ways of doing the same thing. Plus you’ll be able to work with other people’s projects, who may as well use class components.

It’s all about learning, right? :grinning_face_with_smiling_eyes:

Have a nice day!

Thanks @aronkleinhans - I’m just trying to understand in which situations you’d choose class components rather than functional, and it seems the industry preference is functional components where ever possible, so it is functional components I think we need more practice with. However I don’t know if there is a nuanced reason for this lesson to choose to use class components, and I am not experienced enough to know… this is a challenging project for me, so writing it in functional components when the instructions are for class components just creates more likelihood of failure, so I have written the app as per the instructions using class components.

Hey @lucitemple! I totally get your point, and I found you an article on this. :smiley:

1 Like

Hy it is a good explonation of difference of Class and Functional aproach…
https://medium.com/@fibonalabsdigital/react-class-components-vs-functional-components-which-is-better-776d0e2b4ed2

1 Like