So I have searched for solutions but I cant seem to find one that fits with what I am doing. Here is the structure of my website:
So as you can see I have my "NavBar" component outside of the Router because I always want it rendered. But I have a Dark mode toggle on the navbar, and when I click it I want it to update the refresh the Chart component (It is a react-chartjs-2 chart).
I know you can use setState();
to rerender, but how tell the Chart component to do that from the NavBar when I run the onClick();
function that I have inside of it?