mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
fix: 🐛 check window.Event constructor exists in useLocation
IE does not have window.Event constructor.
This commit is contained in:
parent
dbf18e8e70
commit
ad09431145
@ -84,4 +84,6 @@ const useLocationBrowser = (): LocationSensorState => {
|
||||
return state;
|
||||
};
|
||||
|
||||
export default isClient ? useLocationBrowser : useLocationServer;
|
||||
const hasEventConstructor = typeof Event === 'function';
|
||||
|
||||
export default isClient && hasEventConstructor ? useLocationBrowser : useLocationServer;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user