I have a sidebar component that exists in most of my routes in the same place on the screen. I'd like to prevent it from re-rendering if it already exists in the previous route.
Solutions considered: I know that I can create an auxiliary route for this, but that creates a lot of lazy loading and route management issues for me. I'm using ngrx so I've also considered storing the state of the sidebar in the store, but there is a lot of data to manage, so I'd like to avoid that.
Is there a way to prevent a component from re-rendering if it exists in the previous route?