-
In v5 you can have However, with the new function I don't see how to achieve the same separation where the router is defined in an "outer" location and the routes are defined in an "inner" lazy-loaded location. In fact, (for those who don't have this problem and just want a dynamic route matching a static pattern, use "dynamic segments") |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
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:
In the v6 paradigm, you shouldn't add new routes by returning them from child renderers via * I can't find any example code for using blockers or prompting about unsaved changes. Note that
|
Beta Was this translation helpful? Give feedback.
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:
<Routes>
)lazy
)<Prompt/>
)