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: {
106106 : axis . getValue ( d ?. originalDatum )
107107 : undefined
108108
109- const preValue = resolveValue ( focusedDatum )
109+ const datumValue = resolveValue ( focusedDatum )
110110
111111 React . useEffect ( ( ) => {
112- getTooltipOptions ( ) ?. onChange ?.( preValue )
113- } , [ getTooltipOptions , preValue ] )
112+ getTooltipOptions ( ) ?. onChange ?.( datumValue )
113+ } , [ getTooltipOptions , datumValue ] )
114114
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+ )
117121
118122 // Get the sibling range
119123 const siblingRange = siblingAxis . scale . range ( )
You can’t perform that action at this time.
0 commit comments