I think I’m going in circles in order to fix 2 related problems:
- I want something to load to page while data is being loaded up
- I want that data to change as user interacts with chart
I understand the basic premise that anytime state changes, React will re-render the component.
However, I have an event handler that sets some data and returns it. Then ANOTHER event uses that data in setState().
My problem - I think - is that when the first event runs (after user interacts with chart), it changes the data (as expected) but either the 2nd event is not running at all (my guess) OR it’s running but resetting the data back to original state.
Can someone help me figure out what I’m doing wrong? https://codesandbox.io/s/my-app-edhyq
How to replicate problem:
- Drag shaded bar across red area chart.
- For now, this action will filter on the date column to be “2016-7-2”.
Expected: bar charts should all “see” the new date and change accordingly
Actual: nothing on bar charts change.
You can ignore the bottom-right hand chart. It’s got other issues.
Thanks!