You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that fetch supports aborting using AbortController via a signal, it would be nice if we did as well. Currently we track whether the component is mounted and not call setState, but properly cancelling the fetch request would be better, especially since it's considered an anti-pattern
It's only supported in recent green browsers (Chrome, Firefox, Edge, Safari (desktop) and not IE, iOS Safari (currently) so we will need to support opting in / polyfiling.
A quick search returned this polyfill, and Netflix's yetch (which you should be able to pass to the fetchFunction prop
Now that
fetch
supports aborting usingAbortController
via asignal
, it would be nice if we did as well. Currently we track whether the component is mounted and not callsetState
, but properly cancelling the fetch request would be better, especially since it's considered an anti-patternSome details:
It's only supported in recent green browsers (Chrome, Firefox, Edge, Safari (desktop) and not IE, iOS Safari (currently) so we will need to support opting in / polyfiling.
A quick search returned this polyfill, and Netflix's
yetch
(which you should be able to pass to thefetchFunction
propMaybe this is an opt-in via
cancellable
prop, and we continue to track mounted otherwise.The text was updated successfully, but these errors were encountered: