If you want to show the component again without unmounting, you can always show it and hide it when the routes leave. To reach this place, you get a competent external target route, for example, you want to prevent ProjectsList from unmout:
<Route path="/" component={App}> <IndexRoute component={ProjectsList} /> .....
1. Put ProjectsList in the App and instead create the following proxy component component={ProjectsList} :
const LayoutToogler = () => (<div></div>);
It will look like this:
<Route path="/(mobile.html)" component={App}> <IndexRoute component={LayoutToogler} showProjects={true}/>
In the top-level App component, simply check this property ( showProjects ) to decide whether to show projects or not:
<ProjectsList style={{display:this.props.children.props.route.showProjects?'block':'none'}} />
Remember to handle the style property in the ProjectList component.
source share