question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

router.push keeps all views attached

See original GitHub issue

Hello there!

I have an issue where router.push just stacks views on top of each other and you even can click through the views.

Not sure if it is desired behavior, but I expected it to work similar to fragment manager: when you push, current view gets detached and new view is attached. When you press “Back”, previous view gets attached with restored state.

Here is the repo to reproduce: https://github.com/timopl/ribs-push

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:8

github_iconTop GitHub Comments

1reaction
zsoltkcommented, Apr 13, 2020

@Gaket Yes, if it’s the same back stack. Look at it from the parent’s perspective. The parent has control over its own back stack and what things can go there - these are any other RIB that it can build (satisfying their dependencies) and it wants to build (matched to a Configuration).

Although the above does not mean that you always need to have everything that can cover the full screen nested under the same parent. That would result in one “super node” and wouldn’t be efficient. You have some other options:

  1. any level in the tree can be just a container which adds nothing to the view directly (its ViewFactory is null), so its whole available screen space is given to its children.
  2. you can use Portals to open something full screen even if the parent itself has access to a portion of the screen.
1reaction
zsoltkcommented, Apr 7, 2020

Also worth to mention you don’t need to channel your UI event through a Feature to produce a navigation event, that just adds lots of unnecessary steps with no extra benefit. You can bind ui event to router.push directly. Feature is best used for things that are related to changing state.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React history.push() is updating url but not navigating to it in ...
I had this issue on react-router v4 but I solved it after changing the app to only have the BrowserRouter at the top...
Read more >
push a new route only triggers URL change but not location ...
First I was using the push method from connected react router within a saga. I tried absolutely everything to make my route change....
Read more >
Route prefetching in Next.js - web.dev
In this post you'll learn how routing in Next.js works, how it's optimized for speed, and how to customize it to best fit...
Read more >
Using Named Routes and Named Views with Vue Router
We have the to prop bound to an object with the name property to match the name and the params property to pass...
Read more >
React Router with Redux: Understanding navigation state
The Redirect component can take a push prop that deactivates this behaviour. With the push prop, each route is pushed unto the browser's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found