I’m new using React and I’m having this error to use the search bottom in my application.
this the error
This is my code
[enter image description here][3]
I’m also new in stackoverflow, let me know if you need more information.
thank you.
>Solution :
There are a couple of methods how to fix the issue:
- use an arrow function instead:
search = (terms) => {}
- Bind
thisinto your functions you intend to usethis.search = this.search.bind(this);inside your App constructor() afterthis.state
Have a look for more details: React – How to fix this.setState is not a function error