There are a couple of methods how to fix the issue:
search = (terms) => {}
this into your functions you intend to use this.search = this.search.bind(this); inside your App constructor() after this.stateHave a look for more details: React - How to fix this.setState is not a function error