I have a simple ionic app with an IonReactRouter
<IonApp>
<IonReactRouter>
<IonSplitPane contentId="main">
<Menu selectedPage={selectedPage} />
<IonRouterOutlet id="main">
<Route path="/new-user" component={NewUser} />
<Route path="/users" component={UserList} />
</IonRouterOutlet>
</IonSplitPane>
</IonReactRouter>
</IonApp>
When you navigate between new-user
and users
the corresponding pages (NewUser
and UserList
) are not unmounted:
According to this post this is by design
we need to control and keep pages around in the dom even if a user navigates away from them for page transition and state purposes
However I find that most end users expect clicking on 'New User' to show a fresh copy of the page. How can i make the page be unmounted OR achieve the same goal and 'reset' the page when a link is clicked?