Data Re-Fetching in React

Learn to re-fetch data using a dynamic query for the API request.

We'll cover the following

So far, the App component fetches a list of stories once with a predefined query (‘react’). After that, users can search for stories on the client-side. Now we’ll move this feature from client-side to server-side searching, using the actual searchTerm as a dynamic query for the API request.

First, remove searchedStories, because we will receive the stories searched from the API. Pass only the regular stories to the List component:

Get hands-on with 1400+ tech skills courses.