Class Component
About
Articles Related
Syntax
class Welcome extends React.Component {
// Optional. Needed to set state
constructor(props) {
super(props); // Always call the base constructor with props.
}
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}
Feature available only to classes: