Skip to content

Conversation

@SamB
Copy link

@SamB SamB commented Mar 16, 2022

@types/jquery version 3.3.35 and 3.3.36 made some changes to the type
of JQuery.find(), see the PRs:

As a result, the following line in SvgGraph.setSVG would fail to
typecheck:

      this.svg = this.container.find('svg')

But if we change the svg property's type from JQuery<HTMLElement> to
JQuery<Element>, we don't have to care about the changes: it typechecks
either way.

`@types/jquery` version 3.3.35 and 3.3.36 made some changes to the type
of JQuery.find(), see the PRs:

  * DefinitelyTyped/DefinitelyTyped#43857

  * DefinitelyTyped/DefinitelyTyped#44051

As a result, the following line in SvgGraph.setSVG would fail to
typecheck:

```typescript
      this.svg = this.container.find('svg')
```

But if we change the svg property's type from `JQuery<HTMLElement>` to
`JQuery<Element>`, we don't have to care about the changes: it typechecks
either way.
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

Successfully merging this pull request may close these issues.

1 participant