I built an animated box and stored chart inside. The chart will be responsive with animation.

I control responsiveness with this code in the chart component.
onclick = function () {
myChart.resize();
};
The problem is when dealing with multiple charts. I built a chart stored in the other animated box. I want to resize these two charts by clicking on them, but it doesn't work.

I've been trying to figure out how to pass data between components, but so far I can't seem to get it to work. Does anyone have a better way to do this?
・This is my code
https://codesandbox.io/s/echarts-test2-3vg2t?file=/src/chart.js
Regarding Data and how it can be accessed in Sibling Components.
We must note few things about React.
These official docs from react can be helpful: