router.push keeps all views attached
See original GitHub issueHello 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:
- Created 3 years ago
- Reactions:4
- Comments:8
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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:
ViewFactory
is null), so its whole available screen space is given to its children.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 torouter.push
directly.Feature
is best used for things that are related to changing state.