-
Notifications
You must be signed in to change notification settings - Fork 12.8k
navigator.share is not always a function #42809
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
Comments
I'm surprised this definition is provided in the first place, given that it's only specified in a draft specification and only two browsers support it (Edge and Safari, not even Chrome or Firefox). |
There is ton of definitions from Edge Web IDLs so I think this definition is one from Edge. |
Apparently no - it's not from Edge. microsoft/TypeScript-DOM-lib-generator#837 And related to microsoft/TypeScript-DOM-lib-generator#957 |
I have a workaround for now., set a state variable that I update when the component loads
|
Ran into the same issue. Discovered that using |
This worked for me thank you!! |
or |
Bug Report
navigator.share is undefined is many browsers, yet TypeScript reports it as "the function is always defined"
π Search Terms
navigator.share
share
π Version & Regression Information
Version 4.1.5 & Nightly
β― Playground Link
https://www.typescriptlang.org/play?#code/JYMwBAFAdghgbsA5jALgewE4DoDOALGDAUwEowBvAWACgw6wBjNKHNAGyKzbUQgHIAKniJhYKYHBH5CIkEVQBXYmGA4VAWwAOHdUSgoiAEz4kA3DQC+YImxwiqtekxbtO3XoOGjUEqQWVyisqqomgoGtpEuvpGJubUFkA
π» Code
π Actual behavior
TypeScript reports it as "the function is always defined"
π Expected behavior
If should report navigator.share as maybe being present.
The text was updated successfully, but these errors were encountered: