import React from "react";
// https://scrimba.com/p/p4Mrt9/cQnMDHD
class App extends React.Component {
//ctor initializes the component's state
constructor() {
//call the super class constructor to initialize the base class part
super();
//initialize the derived class part
this.state = {
answer: "Yes"
};
}
render() {
return (
<div>
<h1>Is state important to know? {this.state.answer}</h1>
//pass the state to a child component
<ChildComponent answer={this.state.answer} />
</div>
);
}
}
export default App;