DEV Community

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

Collapse
 
dunggramer profile image
Nguyễn Công Dũng

I have a error in useEffect. How to fixed?

React Hook useEffect has a missing dependency: 'fetchData'. Either include it or remove the dependency array.eslintreact-hooks/exhaustive-deps
Enter fullscreen mode Exit fullscreen mode
Collapse
 
hullen profile image
Hullen Gonzales

You can disable it with a comment // eslint-disable-next-line react-hooks/exhaustive-deps. Because fetchData need to be called only on mount component cycle.

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