@@ -28,10 +28,9 @@ const Mesh = ({
28
28
[ point . x + margin . left , point . y + margin . top ] ,
29
29
'top'
30
30
)
31
- setCurrent ( point )
32
31
onMouseEnter && onMouseEnter ( point , event )
33
32
} ,
34
- [ setCurrent , showTooltipAt , tooltip , onMouseEnter , margin ]
33
+ [ showTooltipAt , tooltip , onMouseEnter , margin ]
35
34
)
36
35
37
36
const handleMouseMove = useCallback (
@@ -41,19 +40,17 @@ const Mesh = ({
41
40
[ point . x + margin . left , point . y + margin . top ] ,
42
41
'top'
43
42
)
44
- setCurrent ( point )
45
43
onMouseMove && onMouseMove ( point , event )
46
44
} ,
47
- [ showTooltipAt , tooltip , margin . left , margin . top , setCurrent , onMouseMove ]
45
+ [ showTooltipAt , tooltip , margin . left , margin . top , onMouseMove ]
48
46
)
49
47
50
48
const handleMouseLeave = useCallback (
51
49
( point , event ) => {
52
50
hideTooltip ( )
53
- setCurrent ( null )
54
51
onMouseLeave && onMouseLeave ( point , event )
55
52
} ,
56
- [ hideTooltip , setCurrent , onMouseLeave ]
53
+ [ hideTooltip , onMouseLeave ]
57
54
)
58
55
59
56
const handleClick = useCallback (
@@ -70,10 +67,9 @@ const Mesh = ({
70
67
[ point . x + margin . left , point . y + margin . top ] ,
71
68
'top'
72
69
)
73
- setCurrent ( point )
74
70
onTouchStart && onTouchStart ( point , event )
75
71
} ,
76
- [ margin . left , margin . top , onTouchStart , setCurrent , showTooltipAt , tooltip ]
72
+ [ margin . left , margin . top , onTouchStart , showTooltipAt , tooltip ]
77
73
)
78
74
79
75
const handleTouchMove = useCallback (
@@ -83,26 +79,25 @@ const Mesh = ({
83
79
[ point . x + margin . left , point . y + margin . top ] ,
84
80
'top'
85
81
)
86
- setCurrent ( point )
87
82
onTouchMove && onTouchMove ( point , event )
88
83
} ,
89
- [ margin . left , margin . top , onTouchMove , setCurrent , showTooltipAt , tooltip ]
84
+ [ margin . left , margin . top , onTouchMove , showTooltipAt , tooltip ]
90
85
)
91
86
92
87
const handleTouchEnd = useCallback (
93
88
( point , event ) => {
94
89
hideTooltip ( )
95
- setCurrent ( null )
96
90
onTouchEnd && onTouchEnd ( point , event )
97
91
} ,
98
- [ onTouchEnd , hideTooltip , setCurrent ]
92
+ [ onTouchEnd , hideTooltip ]
99
93
)
100
94
101
95
return (
102
96
< BaseMesh
103
97
nodes = { points }
104
98
width = { width }
105
99
height = { height }
100
+ setCurrent = { setCurrent }
106
101
onMouseEnter = { handleMouseEnter }
107
102
onMouseMove = { handleMouseMove }
108
103
onMouseLeave = { handleMouseLeave }
0 commit comments