
Build a custom useFetch hook
Build a custom useFetch hook that encapsulates the logic for handling the loading and error states when fetching data: const { data, isLoading, error } = useFetch(SOME_URL, MAYBE_OPTIONS); The code should * return the response from the server * handle error and loading states * support custom headers through an options parameter * support ...