mediumEngineering Practices#82

DRY — extract reusable hook

Prompt

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

Hints

Solution

Your Code

10 min

Tests

Click Run to test your code