-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SkipNextPopState = true is preventing initial pushState to take place #526
Comments
Sorry for disturbing you @arturovt , but you seem to be the only help still around here 😨 |
Is there a way to reproduce it in some playground? |
I could try and set it up but I don't have time now.. but I guess my question is why is this skipNextPopState needed ? |
This was done to prevent infinite navigation loops because both single-spa and Angular listen to the popstate event. This simultaneous listening would trigger their internal navigation processes and history calls, potentially causing an infinite loop. |
Okay, but how do you know you are not ignoring valid navigation events ? Should we just discard the first navigation event always ? |
No, this is only ignoring events dispatched by single-spa, and not the actual browser. |
Well I managed to find a workaround with some insight found on this thread , but I still don't understand why is this was necessary in the first place... So I added the
And in my initial navigation I refused to replace the history state, which avoided the
Now I wouldn't have issue with replaceState if not the case of Any thoughts on the matter ? Why did I have to fallback to this ? Thanks for your time!! |
Question
The first
history.pushState(..)
dispatched by other "mfe" is not being consumed by my angular spa, because of this snippet sinceskipNextPopState
is set to true. After that is false and I can already grab the samehistory.pushState(..)
which is triggered by a Nav button.What can I do to stop prevent this behaviour ?
Environment
The text was updated successfully, but these errors were encountered: