Functional Components VS Class Components (CheatSheet)
Functional Class
1. Plain JavaScript Function that accepts props as arguments and return JSX. | 1.Class component Requires to extend from react |
2.No render function | 2.Must Have Render function |
3.There are no lifecycle methods in functional components. | 3.Lifecycle methods can be used in class components. |
4.We can use Hooks directly in Functional components. | 4. We cannot use Hooks directly in Class components, but we can using different Syntax. |
5.No constructors are used in functional components. | 5.Constructors are used in class components. |
Functional:-
Class:-