visx
visx copied to clipboard
TS issues in React 18 due to removal of `onPointerEnterCapture` and `onPointerLeaveCapture` events
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 Pick
s, 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:
- Clone repo
-
yarn
-
yarn tsc