I'm not quite sure what does .bind(this)
is exactly doing in this example? Does it simply connect the specified function to the other components of the code such as this.state
?
constructor(props) {
super(props);
this.state = {
input: '',
messages: []
}
this.handleChange = this.handleChange.bind(this);
this.submitMessage = this.submitMessage.bind(this);
}