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

TS issues in React 18 due to removal of onPointerEnterCapture and onPointerLeaveCapture events #1839

Open
mtlewis opened this issue May 27, 2024 · 2 comments

Comments

@mtlewis
Copy link

mtlewis commented May 27, 2024

There are no onPointerEnterCapture or onPointerLeaveCapture events in React. These events have been erroneously included in typings for a while, but were recently removed in the types for React 18 only.

There are a couple of places in this library where these event names are referenced, and this is causing compilation issues when using the latest version of @types/react 18. The fix doesn't seem to be trivial - from looking at the code, it seems like these event names show up because a few Omit types which drop a few properties from DOM element component types are getting translated to Picks, and therefore including every property from the component. This appears to be limited to BaseAreaSeries.ts and BaseLineSeries.ts.

You can find a minimal repro for this issue in https://github.com/mtlewis/visx-xychart-minimal-repro. Steps to reproduce:

  1. Clone repo
  2. yarn
  3. yarn tsc
@hshoff
Copy link
Member

hshoff commented May 28, 2024

Hi @mtlewis, thanks for reporting

@mtlewis
Copy link
Author

mtlewis commented May 28, 2024

Had a dig into this to see if I could find a sensible fix. Sadly the best I could come up with was #1841, which is rather hacky but at least provides a solution. I'd tend towards option 2 from the PR, but it requires some fiddling with tsconfig, so it's probably better tackled by a maintainer.

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

No branches or pull requests

2 participants