React-router: never unmount a component on a route once mounted, even if route change
Solution 1:
The Switch
component only ever renders a single route, the earliest match wins. As the Dashboard
component is inside it, it gets unmounted whenever another route gets matched. Move this Route
outside and it will work as intended with render
or children
.