cr-ui-lib 1.1.14 → 1.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -903,7 +903,7 @@ var MultiLineGraph = ({
903
903
  chart_js.Legend
904
904
  );
905
905
  const chartRef = React.useRef(null);
906
- const [chartKey, setChartKey] = React.useState(`chart-${Date.now()}`);
906
+ const [chartKey, setChartKey] = React.useState(0);
907
907
  const defaultColors = [
908
908
  { line: "#17CA43", point: "#17CA43" },
909
909
  { line: "#FF6B6B", point: "#FF4757" },
@@ -914,7 +914,7 @@ var MultiLineGraph = ({
914
914
  ];
915
915
  React.useEffect(() => {
916
916
  const handleResize = () => {
917
- setChartKey(`chart-${Date.now()}`);
917
+ setChartKey((prevKey) => prevKey + 1);
918
918
  };
919
919
  window.addEventListener("resize", handleResize);
920
920
  return () => {
@@ -1175,10 +1175,10 @@ var SingleLineGraph = ({
1175
1175
  chart_js.Legend
1176
1176
  );
1177
1177
  const chartRef = React.useRef(null);
1178
- const [chartKey, setChartKey] = React.useState(`chart-${Date.now()}`);
1178
+ const [chartKey, setChartKey] = React.useState(0);
1179
1179
  React.useEffect(() => {
1180
1180
  const handleResize = () => {
1181
- setChartKey(`chart-${Date.now()}`);
1181
+ setChartKey((prevKey) => prevKey + 1);
1182
1182
  };
1183
1183
  window.addEventListener("resize", handleResize);
1184
1184
  return () => {