angelle-sw / use-axios-client

Make axios requests in React using hooks.
https://use-axios-client.io
MIT License
157 stars 7 forks source link

Infinity data loading #134

Open SHrechko150 opened 2 years ago

SHrechko150 commented 2 years ago

isMount reference not setting to true on mount and after unmount useBaseAxios hook in which case we get a bug related to infinity data loading. I think this will help:

useEffect(() => { isMounted.current = true; //<--- try to add this row return () => { cancel(); isMounted.current = false; }; }, []);