-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
useLocation will break on IE11 without Event polyfill #73
Comments
Thanks, I've added a note to docs. |
So glad I found this. App is broken in ie11 without adding the Event polyfill @christiaanwesterbeek provided. |
The polyfill note should be updated. Because of the patch method this breaks IE11 even if you are not using useLocation. I worked around it by importing the hook I needed directly |
happend to me as well, :-( |
Yes, I also encountered this problem |
Shouldn't this be considered a side-effect? Just curious why bundlephobia reports that react-use is side-effect free. |
This issue is just to note that useLocation will break on IE11 without a polyfill for
window.Event
. even when<meta http-equiv="x-ua-compatible" content="IE=edge">
is already in head.IE9, 10 and 11 will break right here when
new Event('pushstate');
is run by callinghistory.push('/something')
in your react app.react-use/src/useLocation.ts
Line 9 in bc3760d
You need to polyfill
window.Event
whichimport '@babel/polyfill';
is not doing for you. So here goes what I've added to my polyfill.jsThe solution was provided here (accepted answer). Don't skip the comments.
https://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
The text was updated successfully, but these errors were encountered: