The Web-Dev Show - By Nabendu Biswas

React class components or functional hook component?


Listen Later

In this third episode, we will discuss about the two type of components in ReactJS - Class components and Functional component and what should we use.

- React class based components were since 2013 and was superior to functional component.


- Functional components were called dumb components, because they were used just for presentational purpose

- Functional components were lacking two important features of class based components ie state and lifecycle methods.

- Class based components created more problems because of the over complicated this keywords and complex lifecycle methods.

- Functional components are more easier to understand, because of the lack of this of javascript.

- The hook useEffect replaces most Lifecycle method and is extremely easy to use.

- If you or your company is starting a new project, go with hook based functional component, as most third party popular modules like react-router have hook counterpart and slowly moving toward hook.

- If you are in a 2-3 year old project then have to work with classes, so it's a must have knowledge.

πŸ™‹β€β™‚οΈ Connect with me
🚨 LinkedIn - https://www.linkedin.com/in/nabendu-biswas/
🚨 twitter - https://twitter.com/nabendu82
🚨 Facebook - https://www.facebook.com/nabendu.biswas.77
🚨Site - https://thewebdev.tech
🚨 Instagram- https://www.instagram.com/nabendu.codes
🚨 Linktree - https://linktr.ee/nabendu.biswas

πŸ”΄ Exclusive Facebook Group for developers https://www.facebook.com/groups/thewebdev4u
πŸ”΄ Exclusive Telegram Group for developers https://t.me/joinchat/H6llKYR0a05hNmI1

...more
View all episodesView all episodes
Download on the App Store

The Web-Dev Show - By Nabendu BiswasBy Nabendu Biswas