You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: I want do discern between two different components based on a prefix of an ID:
/group1/group1-1 -> view this group of things (e.g. a list) /group1/element001 -> view/edit details of an element
Is there already a way of doing this? I tried to abuse nested <Route>s (outer with path="/group1/group*", inner with path=":id") but that did not work (no error, but neither a match for an according URI).
I want to strictly separate concerns, i.e. not parse parts of the path in a component and then display the correct content.
A simple (and completely flexible) solution could be to allow specification of an arbitrary function that gets the (remaining) path (or a matched slug or the contents of a wildcard), and returns a component and the params.
The text was updated successfully, but these errors were encountered:
Problem: I want do discern between two different components based on a prefix of an ID:
/group1/group1-1
-> view this group of things (e.g. a list)/group1/element001
-> view/edit details of an elementIs there already a way of doing this? I tried to abuse nested
<Route>
s (outer withpath="/group1/group*"
, inner withpath=":id"
) but that did not work (no error, but neither a match for an according URI).I want to strictly separate concerns, i.e. not parse parts of the path in a component and then display the correct content.
A simple (and completely flexible) solution could be to allow specification of an arbitrary function that gets the (remaining) path (or a matched slug or the contents of a wildcard), and returns a component and the
params
.The text was updated successfully, but these errors were encountered: