why we should use functional components react code example
Example: react functional component example
function Greeting(props) {
return <h1> Hello, {props.name}! </h1>
}
function Greeting(props) {
return <h1> Hello, {props.name}! </h1>
}