-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abort fetches in react native #3
Comments
Thank you for this issue. I'm not familiar with react-native.
|
I thought the same thing. PS. I've asked this and documented the process directly on the react-native github issue |
I see. |
You're right, but here is where actually the global fetch is overwritten. I was misled by the nodejs part in the readme where it manually imports the abortableFetch from the library while I didn't do that in my react-native code (that's because he imported the module as a ponyfill). All clear then 😄 thank you very much |
Closing as answered. Thank you. |
@giacomocerquone Would be very helpful if you share how you get the abort to work with react-native. Hoping you will! |
Ok, enough! Lots of other people (here) asked me the same question. |
Here the article: https://giacomocerquone.com/aborting-fetch-react-native/ In the next article I will give you some ready to use code to reject requests, but this time instead of giving you code I wanted to explain what is going on and how and why is useless to use polyfills like this in react native as of now. Enjoy, hope I did a good thing! |
@giacomocerquone XMLHttpRequest is baked into the core of react native Web standards are preferred when they are actually implemented. Thanks for the tip on abortController and I will be using axios instead of the half-baked fetch implementation. |
@sebringj damn you're right, I think they added just now that section into the docs (or I completely missed it)! I ask you sorry, I'll edit my post ASAP |
Hi, I have a little problem... probably I'm misleading different specs.
I read this article on how to abort a fetch request: https://developers.google.com/web/updates/2017/09/abortable-fetch
and I'm trying to do so in react-native with your library ('cause the standard AbortController has yet to arrive) but it doesn't abort anything.
This is my code:
The text was updated successfully, but these errors were encountered: