I want to send chart object which refers to ref (useRef) in React to my server ONLY WHEN chart is updated. What I mean for updated is when user add an annotation, label or add technical indicator to the chart (I am using Stock Chart with GUI).
I send you a demo, but probably will not help you a lot unfortunately https://codesandbox.io/s/data-grouping- ... :2554-2673
I want the same functionality that useEffect does with the dependency array. Whenever the chart object is changed, I want to do something. Because for efficiency reasons, I do not want to send request regularly to my server if the chart does not change by the user.
Code: Select all
useEffect(() => {
Some data transfering to server etc.
console.log("Chart is updated");
}, [chart]);
..
..
..
<HighchartsReact
ref={chart}
..
..
/>
Thanks for your consideration!