-
demo as follow: event onPointerOver trigger in error when i try to move mouse on point maked as 2,actually selected point maked as 0, is there any error in my code? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The issue is that To fix this you need to track all the hover states for each of the points. In this example, I turned your https://codesandbox.io/s/funny-sunset-3pftwq?file=/src/App.js |
Beta Was this translation helpful? Give feedback.
The issue is that
setHover
can be set by multiple points at the same time, but can only store one value to show which one is being hovered.To fix this you need to track all the hover states for each of the points.
In this example, I turned your
points
into aHoverPoint
component so that each point can track its hover state separately.https://codesandbox.io/s/funny-sunset-3pftwq?file=/src/App.js