use-hooks/react-hooks-axios

Request cancelled from unmounted component is trying to set state

mcgrathg opened this issue · 1 comments

When the component using this hook is unmounted, it cancels the request, which causes it to catch the error generated from the cancellation.

It then tries to update the state on an unmounted component resulting in this error:
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

Via v1.1.3