What is the best way to dynamically update Navigation bar and side bar in React?
What is the best way to dynamically update Navigation bar and side bar in React? I created a layout component for my react app, and I wanted to dynamically update the side bar and navigation bar on route change. I can use redux, but all of the state and methods will be available at all times, even if i don't need them. I also looked at the new react context, but it has the same problem as redux. With react router, it looks like i'm just mounting a new sidebar or navigation bar. Is there a way to dynamically provide new state and methods to my layout component? (replace the state with a different one, or multiple new once: apple --> orange) React router looks like my best option, but I can do the same thing by just including the sidebar and navigation bar with each new route. Dynamically adding links is not a problem, adding a button that affects the newly mounted component is the problem. The navigation bar and side bar lives in the parent component, so they need to k