File tree Expand file tree Collapse file tree 2 files changed +1830
-1826
lines changed Expand file tree Collapse file tree 2 files changed +1830
-1826
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,18 @@ function Cursor<TDatum>(props: {
106
106
: axis . getValue ( d ?. originalDatum )
107
107
: undefined
108
108
109
- const preValue = resolveValue ( focusedDatum )
109
+ const datumValue = resolveValue ( focusedDatum )
110
110
111
111
React . useEffect ( ( ) => {
112
- getTooltipOptions ( ) ?. onChange ?.( preValue )
113
- } , [ getTooltipOptions , preValue ] )
112
+ getTooltipOptions ( ) ?. onChange ?.( datumValue )
113
+ } , [ getTooltipOptions , datumValue ] )
114
114
115
- const value = props . options . value ?? preValue
116
- const latestValue = props . options . value ?? resolveValue ( latestFocusedDatum )
115
+ const value = props . options . value ?? datumValue
116
+
117
+ const latestValue = useLatestWhen (
118
+ props . options . value ?? resolveValue ( latestFocusedDatum ) ,
119
+ typeof props . options . value !== 'undefined'
120
+ )
117
121
118
122
// Get the sibling range
119
123
const siblingRange = siblingAxis . scale . range ( )
You can’t perform that action at this time.
0 commit comments