usePermission throws exception in iOS Safari
What is the current behavior?
When testing on BrowserStack with a physical iPhone 11 in Safari, navigator.permissions.query is throwing an exception within usePermission.

Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than react-use. Paste the link to your JSFiddle or CodeSandbox example below:
Run the code in Safari on desktop. Or, sign up for BrowserStack (free) and open an app that uses usePermission in Safari.
What is the expected behavior?
usePermission should probably no-op if the Permissions API is not supported. Alternatively, for each kind of permission, it could try and support what Safari is able to support (notifications, mostly).
See Google polyfill for an example: https://github.com/chromium/permissions.request
Workaround
I haven't found one yet since Rule of Hooks states you can't conditionally execute a hook. Polyfilling the APIs that I need (notifications) may be the only alternative that is compatible.
A little about versions:
- OS: iOS
- Browser (vendor and version): Safari v13
- React: 16.13
-
react-use: 15.1.1 - Did this worked in the previous package version? No
Contrary to what the linked PR says, I don't think this is fixed on master. Still seeing this error on iOS Safari, as well as on MacOS Safari, when using the latest version of react-use.
Hmm interesting, I assumed it was, maybe the PR needs to be re opened and updated.
I'm seeing this on safari on mobile and desktop
This is still throwing an exception in 17.4.0 on safari on all plaftorms...