Skip to content
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

QuerySelect is named as QuerySelector in the official documentation #21

Open
rzinnatullin opened this issue Feb 5, 2021 · 3 comments
Open

Comments

@rzinnatullin
Copy link

I'm using Type Script, and there's already the types for the official DOMParser types.
Here are the types for QuerySelector function:
image
And this is the official documentation https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector

The problem is that for some reason in this package we have querySelect instead of querySelector, and this fact breaks type checking:
image

Any reason for having a different name? Can this be fixed?

@mpestka
Copy link

mpestka commented Feb 22, 2021

similar issue with getElementsByAttribute in typescript (although code works it does not compile in ts)

const doSomethingWithDocument = (document: HTMLDocument): void => {
  const styledElements: HTMLCollectionOf<Element> = document.getElementsByAttribute('style');
  ...
 error TS2339: Property 'getElementsByAttribute' does not exist on type 'HTMLDocument'.

@adbalits
Copy link

adbalits commented Jun 4, 2021

Slightly off topic, but I tried yarn add --dev @types/react-native-html-parser and it didn't work. Were you guys able to get TypeScript working with this package?

@AlenToma
Copy link

AlenToma commented Feb 2, 2022

Created advanced-html-parser and added more feature and typescript support. Please check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants