3

While willman's critique of your code is correct (I was going to add all that into my answer as well - you should definitely be saving that data in state, not a class property, and relying on the fact that when you call setState(), React will automatically re-render, without having to call forceUpdate()), I want to answer your real question: What will be ...


1

You should not be storing your results in a class variable and calling forceUpdate. Instead, you should store the results in state (see docs on state). React is purposefully built to run your render method whenever state changes. That way you don't have to blank anything out, when they click the button, the first 6 items stay there until your api call ...


Only top voted, non community-wiki answers of a minimum length are eligible