In the image, UI is broken down into multiple pieces and that is called “Component”. Here the components are Header, Side menu, content, and footer.
The component has to include the extended React. A component statement, this statement creates an inheritance to React. Component, and gives your component access to React.Component’s functions.
There are pros and cons to both types of components but I would like to conclude that functional components are taking over modern React. The functional component is written shorter and simpler, which makes it easier to develop, understand, and test. Functional components can keep everything clean. It also supports React Hooks which will make performance optimizations by avoiding unnecessary checks and memory allocations.