how to define function in reactjs in functional components code example
Example 1: react function component
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
Example 2: react functional component example
function Greeting(props) {
return <h1> Hello, {props.name}! </h1>
}