I’m using a ionic stencil starter pwa with ionic router .
I’m in a page and I need to push again that same page but with a different prop, so the page will be loaded from the start with the new prop and re-render.
I’m using
const navCtrl: HTMLIonRouterElement = await(this.nav as any).componentOnReady();
navCtrl.push("/pagename/" + prop + "/", "root");
if I’m in a different page, my push works correctly. the problem is when I’m in the same page, nothing happens.
Why this happens? there Is a way to make it works?
Consider using observables which you can subscribe to and update your page.
You could begin by looking at this post,
I’ve asked in different places and all the answers were to change the logic of the page…
But I would like to know why push like as usual don’t work.
I’ve already developed the pwa so change the logic should be the last chance.
The page is affected by lifecyle events kindly read more on https://ionicframework.com/blog/navigating-lifecycle-events/
Use observables it will make what you are trying to do painless. That basic idea here is that your page only needs to subscribe to the observable and the view updates when new values are emitted whether you are in the same page or came from a different page.
Right now am not able to skin a working example for you am swamped by a project am racing to complete for launch.