AddRoute() with ParentName does not add routes as Children of the parent. #2251
Unanswered
dharnil
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What problem is this solving
AddRoute() with ParentName does not add routes as Children of the parent
I came across this issue when I was trying to access children of a Route but kept getting undefined.
I am trying to get the router object with all the routes consisting or parents and child routes but Unflattened.
router.getRoutes()
-> Flattened ArrayI need to know which route is child and which is not. This functionality will improve the way we resolve routes and catch errors for 3rd party integration.
1 of the challenges I am facing is to be able to get the list of all the children of a parent route.
Code Structure:
When I try to run a for loop to console.log(children of Home)
Its always undefined.
I know a very rough gist of what is wrong here but I would highly appreciate an explanation for this behaviour.
🥲🥲🥲🥲!!!
My Request
The above code add the route just fine but has implication on resolution of routes with scrutiny based architecture.
It would be great to see if we could add a way to differentiate weather 🌦️ a route is child or is parenting other routes.
Discussion History Reference
Related: #600
Proposed solution
I would like
router.addRoute( ParentName, childRoute )
to be accessible byparentRoute.children
Describe alternatives you've considered
An alternative is adding the updated parent route again.
Beta Was this translation helpful? Give feedback.
All reactions