You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It exists widely doesn't necessarily mean it's good to use; I would double check the history to understand why this was deprecated.
It is true that it is not the best option to use in modern days, but browsers support it according to MDN.
Also, sometimes we need to use it. These are some use cases
1 - Accessing HTML-Specific Properties or Methods
2 - Type Narrowing for Specific Document Types
3 - Custom HTML Document Handling
That said, browsers haven't follow the deprecation and still have HTMLDocument, and per whatwg/dom#221 the consensus seems to be that the deprecation isn't worth doing. Maybe we should follow the consensus.
Summary
For some reson Typescript says HTMLDocument is deprecated, but it is not
Expected vs. Actual Behavior
Even though MDN says it is widely available, TypeScript says it is deprecated.
Playground Link
https://www.typescriptlang.org/play/?#code/CYewxgrgtgpgdgFwAQEs4GcEEM5hiAMyQAkAVAWQBkARcaeBIA
Browser Support
Have Tried The Latest Releases
@types/web
.Additional Context
No response
The text was updated successfully, but these errors were encountered: