Functional Components

Functional components are those components that are created using the help of functions. They use hooks for lifecycle methods like useEffect. Functional components also use hooks to replicate the behavior of class-based components.

Functional components are known as stateless components but they can be made stateful using the hook useState.

  • The general syntax of functional components:
function Welcome(props){
return <p> Welcome, {props.name}</p>;
}

Or 

const Welcome = (props) => {
return <p> Welcome, {props.name}</p>;
}