Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49082

Ionic-react history.replace() not navigating

$
0
0

I am working on an Ionic react application (v5.0.7).
I have all my paths inside <IonRouterOutlet>.
For the navigation stack management, setting root I am using history.replace() method, but it is not navigating to that screen.

I have a scenario like. From the login screen after the correct login, I want to set root as a Home screen. So I am using history.replace() to navigate to the Home screen, but the home page is not shown (willEnter,DidEnter none of the methods are called).
In Route element, if I console in the render method of home it prints the log, and in Ionic serve the URL is also changed on the top but the page is not changed (no error in console for this)

Now with the same code if I just change history.replace() to history.push(). it starts working and navigate to the home page, but it will allow logged in user to go back to the login screen without login

What can be an issue in this as it is not displaying the home screen

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 49082

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>