visx icon indicating copy to clipboard operation
visx copied to clipboard

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

Open mtlewis opened this issue 9 months ago • 2 comments

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

mtlewis avatar May 27 '24 14:05 mtlewis