I'm trying to learn basic React I want to build the cocktail page which allows the user to search for specific cocktails I've used cocktailsdb API but and tried to use Axios but when I'm trying to search the result won't come out because there is no data. I don't know the source for this problem image
The issue is because you've got a line break here: https://github.com/MatanSofer/Cocktail-Bar/blob/e21c5cc266c23cb2e47e26ea31de102ef26d791f/components/search/Search.js#L27
Particularly this line:
axios
.get(`https://thecocktaildb.com/api/json/v1/1/search.php?s=
${term}`) //pay attention is the letter next to digit 1
If you look at the network request, you'll see a tun of spaces preceding the search term.
If you change that line to:
axios
.get(`https://thecocktaildb.com/api/json/v1/1/search.php?s=${term}`)
It works fine: