A component is an independent, reusable code block which divides the UI into smaller pieces.
1-functional Component
2-class Component
A functional component is basically a JavaScript/ES6 function that returns a React element (JSX).
a Functional Component in React:
β>is a JavaScript/ES6 function
β>must return a React element (JSX)
β>always starts with a capital letter (naming convention)
β>takes props as a parameter if necessary
Class components are ES6 classes that must have an additional render( ) method for returning JSX.
A Class Component:
β>is an ES6 class, will be a component once it βextendsβ a React component.
β>takes Props (in the constructor) if needed
β>must have a render( ) method for returning JSX