Solution Review: Remember Last Searches

Learn to fetch stories for the search term when the button is clicked by recalling last searches.

We'll cover the following

Solution

First, we will refactor all url to urls state and all setUrl to setUrls state updater functions. Instead of initializing the state with a url as a string, make it an array with the initial url as its only entry:

Get hands-on with 1200+ tech skills courses.