v6 dynamic segment with enumerated values #10951
Unanswered
JakobJingleheimer
asked this question in
Q&A
Replies: 1 comment 8 replies
-
Can you provide a minimal reproduction? |
Beta Was this translation helpful? Give feedback.
8 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use route params for (among other things) determining API requests and also specify a component for each valid value. The following works in terms of route params and mounting the layout component
SectionContainer
(which contains an<Outlet />
), but the appropriate route component is not loaded.I've tried a couple variations of this (ex adding a "wrapper"
<Route path=":section">
and nesting<Route Component={SectionContainer}>
within), but everything I try has the same result:Matched leaf route at location "…/foo" does not have an element or Component. […]
I feel like this should be possible, I'm just not finding the right mix.
P.S. Sorry if this has already been answered—I looked through discussions, issues, and the docs, but I didn't find anything.
EDIT: repro https://codesandbox.io/s/react-router-v6-dynamic-param-enums-xs9ncr?file=/src/index.js
Beta Was this translation helpful? Give feedback.
All reactions