DEV Community

Discussion on: React Custom Hook - useFetch

Collapse
 
daveteu profile image
Dave

Good write up on the hook. I was looking to create a useFetch hook and came to this, though my intention was completely different.

I was looking to create an useFetch hook that returns a fetch function that handles all the error (displaying them in snackbar), so you will end up handling all the error in one place.

For the same functionality in your write up, with additional feature to memorize and caching the results, may I also recommend useSWR. It's created by the same people behind NextJS and vercel and it's really good.

Collapse
 
techcheck profile image
Andrew

Wow, great! Good call thank you