Skip to content

Can I add routes dynamically? #10871

Closed Answered by qwertie
qwertie asked this question in Q&A
Sep 15, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

After trying to understand this thing for much longer than I would like, my sense is that react-router v6 is actually two different routing libraries masquerading as one: the v5 library (tweaked for more consistency with v6) and the v6 library (indicated via phrases like "data API" or "data router"). Each of these may have features that the other lacks, something like this:

Feature v5 v5-inside-v6 v6
Dynamic segments
Building routing tree incrementally ✅ (child components render <Routes>) ✔ (lazy)
"blockers" ✔ ("unstable")* ✔ ("unstable")*
Prompt about unsaved changes before navigating (<Prompt/>) ❔* ❔*
Regex routes
Unload period (time for modals to fade…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@achtan
Comment options

@qwertie
Comment options

Answer selected by qwertie
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