How to hide Parent when child route is active
See original GitHub issueHi,
I tried to implement React Router example. Here’s the codesandbox link.
The links at top is the breadcrumb
The links to Bus
and Cart
at bottom is present on the parent route Tacos
but is visible on child route Bus
or Cart
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Hide parent view in angular 2 - Stack Overflow
Make separate component for the one you called parent (ParentComponent) and for the one you called child (ChildComponent) ...
Read more >Hide parent component but show child-angular.js
No way to do it, that's just a part of how parent and child component relationship works. The parent contains the child component,...
Read more >How to hide parent route, when navigating to child route?
In react-router it is history.push(path, state) then you can read the stat from location . There is useHistory hook, and I guess there...
Read more >How to navigate to a parent route from a child route?
Directly using the routerLink directive in case of linkage of child to parent. Using Route class in case of navigation to happen on...
Read more >Angular Router: Children or LoadChildren?
Make sure you import all NgModules for each component defined in the nested route table. Otherwise, your code would not work. To help...
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 Free
Top 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
Thanks @icd2k3 for the fast and prompt answer ❤️
@pjvds it’s a bit verbose, but since
location
is passed to dynamic breadcrumbs, we can use that to determine wether or not to show “Tacos”Here’s a codesandbox