Why to use Class Components?

All the problems in React cannot be solved with functional components. If you want to maintain the local state of the component then use class components.

  • Class Components hold and manage the state of the components.
  • They have lifecycle methods that will be called when a component is mounted, updated and unmounted.
4 Likes

could your briefly explain what are the applications or where we use class based components instead of functional based components . Actually most of the people will use functional component to reduce the effort . But i want to know what are the exact benefits for class based components