This may be a common question, can someone suggest which one to follow for better clarity and performance?
Question : Is it better to use useState variable or setOption method in EchartsInstance?
We are using React JS to design our components, for charts we use Apache Echarts.
Usually we have useState variable like the below one,
const [options, setOptions] = useState(defaultChartOptions);
where defaultChartOptions is an object with grid, title, tooltip, legend, xAxis, yAxis, series etc.,
For every one minute of refresh, we update the useState variable correspondinly. Echarts have setOption when to use or do we have to use it always to update the state of charts instead of useState variables?