why class components react code example
Example 1: react class component
class Welcome extends React.Component {
render() {
return Bonjour, {this.props.name}
;
}
}
Example 2: class component in react
class Car extends React.Component {
render() {
return Hi, I am a Car!
;
}
}