why use functional components code example
Example 1: react functional components
const component = () => {
console.log("This is a functional Component");
}
Example 2: react functional component example
function Greeting(props) {
return <h1> Hello, {props.name}! </h1>
}