Answer the question
In order to leave comments, you need to log in
What is the first thing created in this js code??
class Application extends React.Component {
constructor(props) {
super(props);
this.state = {isDangerAlertShowed: true}
this.toggleDangerAlert = this.toggleDangerAlert.bind(this);
}
toggleDangerAlert() {
this.setState(prevState => ({
isDangerAlertShowed: !prevState.isDangerAlertShowed
}));
}
Answer the question
In order to leave comments, you need to log in
The method is in the prototype.
The constructor is called when an instance is created.
When you create an instance, the prototype is already defined.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question