DEV Community

Discussion on: useAxios : A simple custom hook for calling APIs using axios

Collapse
 
joaorr3 profile image
João Ribeiro

Nice! But it's more useful to export a fetch action instead of the data. This way you can fetch data when you need it instead of doing it only on mount. You also need something like redux or context to set/get the api response.

Some comments have been hidden by the post's author - find out more