Skip to content
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

Need a pushReplacementNamed and pushReplacement for RouterComponent #2177

Closed
ufrshubham opened this issue Nov 22, 2022 · 3 comments · Fixed by #2249
Closed

Need a pushReplacementNamed and pushReplacement for RouterComponent #2177

ufrshubham opened this issue Nov 22, 2022 · 3 comments · Fixed by #2249
Assignees

Comments

@ufrshubham
Copy link
Member

Problem to solve

As of now, there is no way to push and replace current route with a new one in a single call. It can be achieved using two separate pop() and push() calls, but only if there are more than 2 routes on the stack.

My use case involves an OverlayRoute as the initial route and a normal component based route. To navigate from the initial route to the component based one, I have to first pop() the initial route (because OverlayRoutes are always rendered on top). But in doing so, the length > 1 assertion gets triggered.

Proposal

It would be good to have pushReplacementNamed and pushReplacement style APIs for RouterComponent, similar to flutter's navigator.

More information

@spydon
Copy link
Member

spydon commented Nov 22, 2022

Should I assign you to this @ufrshubham or do you want to take it @st-pasha?

@ufrshubham
Copy link
Member Author

Should I assign you to this @ufrshubham or do you want to take it @st-pasha?

I am completely new to the routing system, so it would be better if Pasha takes a look at this.

@munsterlander
Copy link
Contributor

@spydon You can assign this to me. I think I have it all done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants