react js class vs function code example
Example 1: class app extends component syntax
class Welcome extends React.Component {
render() {
return Hello, {this.props.name}
;
}
}
Example 2: react functional components
const component = () => {
console.log("This is a functional Component");
}