Comments (18)
i need to add these polyfills
import 'promise-polyfill/src/polyfill';
import 'unfetch/polyfill';
import 'abortcontroller-polyfill'
import 'url-search-params-polyfill';
from use-http.
I had to do yarn build
in use-http
to make the test project work.
After adding the basic cra-app polyfill it seems like your ie-support fix branch is working. No need for me to polyfill anything extra. Tested in internet explorer 11. Nice! 🔥
from use-http.
I'm so excited
from use-http.
If people are going to start testing their react app on explorer then it will crash because of react issues before it reaches your fetch library.
from use-http.
So anyone trying to get this to work in IE, just add these lines to the top of your main/root App.js
file.
import 'react-app-polyfill/ie11'
import 'react-app-polyfill/stable'
from use-http.
Will hop on this soon
from use-http.
@Fled8617 It sounds like you might be on a Microsoft computer since you're using IE. It's kind of a pain to test IE on mac. Would greatly appreciate if you could submit a PR!
from use-http.
I'm so excited I'm pretty sure I figured out a way to make this work.
from use-http.
This might be fixed as of #196
As soon as I get a windows machine I'll test this, but until then, anyone who has a windows machine who might be able to confirm that this works, please comment on here so I can close this.
from use-http.
It's not working for ie11 without the polyfills mentioned by @fred8617
from use-http.
Mind submitting a PR @Akswii? I removed the Proxy
so it shouldn't be too far off.
from use-http.
Sorry, I don't have the time to look into it. Included the polyfills and got it working for my project. I appreciate your work @alex-cory 🙏
from use-http.
@Akswii so you didn't need to add a polyfill for Object.entries
?
from use-http.
These are my current polyfills. I think a polyfill for Object.entries
is included in one of the CRA polyfills.
from use-http.
I double checked, Object.entries is not polyfilled with the react-app-polyfill
, nor in any of the other packages as far as I can tell. Not sure if this is helpful or not @alex-cory
from use-http.
@Akswii I'll make a branch, but could you pull down the branch and test it on your windows machine? Steps
git clone [email protected]:alex-cory/use-http.git
cd ./use-http
git checkout ie-support
yarn
yarn link
cd ..
create-react-app use-http-cra-app
cd ./use-http-cra-app
yarn
yarn link use-http
cd ../use-http
npm link ../use-http-cra-app/node_modules/react
npm link ../use-http-cra-app/node_modules/react-dom
cd ../use-http-cra-app
yarn start
Now just go into your use-http-cra-app/src/App.js
and import use-http
and test it in ie. I still need to make the ie-support
branch so bare with me.
from use-http.
@Akswii when you say the basic cra-app polyfill, you are saying put these in the useFetch.ts
?
import 'react-app-polyfill/ie11'
import 'react-app-polyfill/stable'
I might just put this in the documentation. If you need ie11 support, use these polyfills. Or... maybe I just import them, and just have them as devDependencies, then will just use them at build time. 🤔 Thoughts?
from use-http.
@alex-cory correct. Yes you can do that / just have a link or reference to the react docs as they cover this if you want to be ie11 compatible.
from use-http.
Related Issues (20)
- function to overwrite global options don't update after dependency change HOT 6
- useFetch `post` call inserts quotes when passed a string HOT 6
- React Native and Cache
- [Feature Request] time denounce http get requests
- does useFetch have option for skip request?
- Data not populated at mount HOT 5
- React 18 StrictMode HOT 22
- `Error: Invalid hook call` after upgrading to React 18.1 HOT 1
- Interceptors aren't chained HOT 8
- Cannot abort delayed retries
- use-Fetch Post is having issue with csrf headers HOT 7
- [Feature Request] A way to invalidate the cache HOT 1
- Upload File Progress
- can recall post when parameter change?
- does post can auto fire? HOT 2
- Eslint rule react-hooks/exhaustive-deps questions on having response as depency HOT 1
- React 18 not supported? HOT 1
- Following instructions in .github/contributing.md fails when using the latest React 18 HOT 2
- Initial URL with a trailing slash adds double slash on relative urls
- TS: Ability to add expected type for fetch body. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from use-http.