lightweight-charts-react-wrapper
lightweight-charts-react-wrapper copied to clipboard
Maximum update depth exceeded error when using setState inside onCrosshairMove
Any setState call inside onCrosshairMove handler function causes Maximum update depth exceeded error
Even simple examples cause this problem:
const [time, setTime] = useState<MouseEventParams['time']>(undefined)
const onCrosshairMove = (event: MouseEventParams<Time>) => setTime(event.time)
For now the only way I can handle it is by wrapping handler function with debounce with 0 delay
I can not reproduce https://codesandbox.io/s/codesandboxer-example-forked-ns9v5r. Could you give an example with the reproduction of the problem?