react-apexcharts icon indicating copy to clipboard operation
react-apexcharts copied to clipboard

Using state values in react in a label formatter fails to update labels

Open dagstuan opened this issue 4 years ago • 3 comments

Bug report

The issue can be reproduced in the codesandbox below. Click the toggle button to switch between a state value. The labels update the first time, but then stops to update.

https://codesandbox.io/s/react-basic-example-k0gjm

Explanation

  • What is the behavior you expect? I expect the labels to update when I change the state value.

  • What is happening instead? It works the first re-render, and then stops working

  • What error message are you getting? None.

dagstuan avatar Mar 02 '20 14:03 dagstuan

Just happened upon the same issue, apparently setting a different id for the chart every render fixes it.

EdPirro avatar Apr 03 '20 18:04 EdPirro

https://codesandbox.io/s/react-basic-example-mmmi9 Working now. (From your sandbox :) ).

EdPirro avatar Apr 03 '20 18:04 EdPirro

Thank you so much buddy : ) 👍

vikasbenvanshi7 avatar Aug 08 '22 09:08 vikasbenvanshi7