By default, queries that unmount or become unused before their promises are resolved are not cancelled.
Both React Query and SWR work with providing your own fetcher. Cancelling requests depends on what fetcher you use...
// Example abort with fetch:constcontroller=newAbortController()fetch('https://google.com',{signal:controller.signal}))controller.abort()// Example abort with axiosconstsource=axios.CancelToken.source()axios.get('https://google.com',{cancelToken:source.token})source.cancel()
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
SWR will not cancel processing tasks while react-query will do that on these aspect react-query is bit ahead.
From React Query documentation:
Both React Query and SWR work with providing your own fetcher. Cancelling requests depends on what fetcher you use...