I´m trying to build a react NavBar that has a switch button that changes the theme of the page. The theme is a bootstrap theme that is passed in a element to a helmet component, all within the navbar for now.
This switch button changes the state, and then a function, according to the state returns one of two elements with different hrefs (bootstrap themes) that then it gets rendered in the helmet element.
The problem is, when I change between pages with Router, the state resets and so does the theme. Can you think of a solution? How do I keep the state even after changing pages?