Class Components
In typical words its a class which have a built-in state object, You may have observed earlier in the component constructor section that we utilized the term "state". The state object serves as a container for property values specific to the component. When modifications occur within the state object, the component undergoes re-rendering.
Functional Components
Functional components in React.js are a type of component that are primarily defined as JavaScript functions. They are also referred to as stateless components or functional stateless components. Functional components accept props (properties) as input and return React elements to describe the user interface.
There are several reasons why it's advisable to favor functional components over class components in React, for example:
Functional components offer a simpler and more straightforward approach compared to class components. They don't entail the additional complexity of managing lifecycle methods, state, and binding this.