Skip to content

Create a nested router possible? #334

Answered by arctic-hen7
aWeinzierl asked this question in Q&A
Discussion options

You must be logged in to vote

From my understanding, the general idea of the Router component is that you only have one in your app. If you were to nest them, which router would control which page transition? I'm struggling to think of a use case in which you would ever need more than one router, what exactly do you have in mind?

Usually, what you would do is just define all your routes in one enum (as is documented) and then provide that to the router. Then, it will automatically pick up any links in your app to internal pages (e.g. an anchor element with href = "about") and prevent the default browser behavior of loading the new page, instead just replacing the View, reducing the number of requests that need to be m…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@aWeinzierl
Comment options

@arctic-hen7
Comment options

@aWeinzierl
Comment options

@arctic-hen7
Comment options

Answer selected by lukechu10
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants