DEV Community

Discussion on: Asynchronous Flows...with React Hooks!

Collapse
 
vyckes profile image
Kevin Pennekamp

Its not really a cancellation, as the fetch will still finish, but this implementation ensures that nothing will happen if the component is not mounted anymore.

Collapse
 
chrisachard profile image
Chris Achard

Right, yes (which is why I was pointing out the AbortController as well) - but yes, good to point out that it doesn't actually cancel the request :)