Now create the searchArtists function. We use axios to perform the GET request to the spotify API endpoint. As request configuration we pass an object which contains the header with the Bearer Authorization and the token. As well as a params object containing the search term and the type of search which is here set to artist.
Once the request is done, and the fetch successful the response is set to our artists state.