Refactor duplicate code into a custom useFetch hook that takes a URL and returns { data, isLoading, error }.
Click Run to test your code