HomeReactContact
React
Are React class components still needed in 2021
Nikola Grujicic
1 min

Short answer, yes. React class components are rearly used in modern React development but we still need to know them in case we need to work on old legacy projects. If you want to embrace modern React, then you should use function components with hooks. Most tutorials today are teaching React development with no class components at all.

React class components are always going to be there and there is always an old project that uses class components that you will have to work on, it is good to know how they work.

The main reason for the sharp decline in the use of class components would be the introduction of react hooks.

Conclusion

If you prefer using class components over function components with hooks or if you are working on an old “legacy” project, you should probably use them. However, keep in mind that using React Hooks comes with many advantages.

Here is a video from React conf 2018 that explain it all in more details: React Today and Tomorrow and 90% Cleaner React With Hooks


Related Posts

Is Context API Better than Redux and can it replace it ?
3 min
© 2021, All Rights Reserved.

Quick Links

Advertise with usAbout UsContact Us

Social Media