What is the difference between a class and functional component.
Anonimo
A class component has “this” which allows a component to set up global variables, state, and call props. A functional component doesn’t have this and must inherit it from its parent component. However, class components have fallen out of favor, as hooks have given functional components the ability to maintain state.