Since the update to React Router v6 the way to render children with params has changed. Previously in v5 you could define expected params in the URL to render a child based on an expected param, but now you can't. Currently updating from v5 to v6 and it's causing issues with routing currently.
I have looked through a few locations in the new documentation, but can't seem to find what I am looking for:
From the documentation:
<Route path="parent" element={<Parent />}>
<Route path=":child" element={<Child />} />
</Route>
What I am trying to do:
<Route path="parent/:child" element={<Parent />}>
<Route path="parent/child1" element={<Child1 />} />
<Route path="parent/child2" element={<Child2 />} />
</Route>
In v5 you could do something where you define the params you expect:
path="parent/:child(child1|child2)"
Is there any way to do this in v6 now? The documents are pretty sparse and not very descriptive. Anyone have a solution to this?