The concepts in the project build on the knowledge from the stateless/stateful component lessons preceding the project. Yet the complexity is not detailed out, so I can’t rationalize the learning as I was able when going through the Video Player project
For example, the necessaty of binding methods in the constructor is clear to me:
event.preventDefault() is necessary in handleSearch() because they have you attach it to the click event of a stylized link. In order to prevent the default behavior of the browser to follow a link that is clicked, event.preventDefault() is called. If they had used a different HTML element to attach it to, then it may not be necessary.
I think part of the confusion is that you aren’t placing it where they intended you to put it. It shouldn’t be sent to the searchYelp() function, but instead should be called on its own. I recommend putting it on the first line of handleSearch() so that if your call to searchYelp causes an error, event.preventDefault() will have already been called and the browser won’t attempt the follow the link.
You listed all the state properties but seem to be referring to them as methods, though I may be misunderstanding you.
You should have binded this to each of the handler methods (e.g. handleTermChange, handleLocationChange, etc.) in order to be able to use this.setState() to update the state of each of them.
You’d still need to access them using this.state.whatever like you had to in App.js to access this.state.businesses.