Skip to content

Dynamic routing #13765

Answered by sergiodxa
jukkahuuskonen asked this question in Q&A
Discussion options

You must be logged in to vote

In createBrowserRouter you can pass a second argument with a patchRoutesOnNavigation method to dynamically register routes, and you can use any logic you want to add them there.

But I think it would be simpler to register every route and in the route loaders only allows access to certain routes based on what those devices allow or not, and if not render a 404 or 403 page.

Replies: 1 comment

Comment options

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