Hello, I am having an issue updating the dataset shown.
This is the setup:
I have a component which has a sidebar with different names for the datasets and a pie chart.
The dataset of the is tied to data[display] where data is an array received by props and display is automatically set to the first key in the array and is reset to the option selected in the sidebar.
The question is:
When I start the app it renders correctly, and it also switches between the datasets correctly EXCEPT for the first dataset (used on initial render)
If I console.log the data[display] object it shows the correct one but the piechart ignores the change... therefore the first chart is only shown on render, and then I can only view the second and third one but can never return to the first.
Hello, I am having an issue updating the dataset shown.
This is the setup: I have a component which has a sidebar with different names for the datasets and a pie chart. The dataset of the is tied to data[display] where data is an array received by props and display is automatically set to the first key in the array and is reset to the option selected in the sidebar.
The question is: When I start the app it renders correctly, and it also switches between the datasets correctly EXCEPT for the first dataset (used on initial render)
If I console.log the data[display] object it shows the correct one but the piechart ignores the change... therefore the first chart is only shown on render, and then I can only view the second and third one but can never return to the first.
Why is this? Is there a solution?