Dynamic routes and parent/child relationships #2573
Unanswered
davidknapman-cl
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
Uh oh!
There was an error while loading. Please reload this page.
-
I want to be able to interrogate a
router, based on a named route (rootRouteName). Every immediate child route of that named route should be turned into aTTabobject, and we then iterate over those tab objects to create a tab control using our UI framework.So in a composable, I have this definition, slightly simplified
This has been working fine provided that the children are defined when the router is first created. But now we're wanting to have a variable number of tabs based on metadata we're retrieving via an API call. That logic is iterating over an array of items and calling
But this fails miserably. Even accounting for
routernot being reactive, even if we play a trick to forceallTabsto be recomputed (e.g. toggling a booleanrefthatallTabsreads from at the top), we find thatchildrenis still in its original state.I've found a few suggestions that I shouldn't expect
childrento be updated - but is there some api that I'm missing to be able to ask "given this route name, what immediate child routes exist, taking into account dynamically added routes?"Beta Was this translation helpful? Give feedback.
All reactions