Answer the question
In order to leave comments, you need to log in
Why is setState not working, is there an error?
Why do I have an error in this case?
Answer the question
In order to leave comments, you need to log in
Add to the constructor:
// This binding is necessary to make `this` work in the callback
this.handleSearchs = this.handleSearchs.bind(this);
The function is not bound to any context. Write either an arrow function
Or put a binding on the function:handleSearch = event => {}
onChane={this.handleSearch.bind(this)}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question