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
I would like the router to be able to match and interpret parameters attached to parent paths. This would be particularly useful when using the Outlet component to manage tabs or similar features, as the useParams hook could be used to conveniently extract these parameters.
For example, consider the scenario where an absolute route path "/setting" is nested under a parent path "/:tabKey", as illustrated in this CodeSandbox:
Currently, attempting this results in an error stating:
"Absolute route path "/setting" nested under path "/:tabKey" is not valid. An absolute child route path must start with the combined path of all its parent routes."
If React Router could be enhanced to handle this scenario without generating an error, I believe it would open up new possibilities for flexible and efficient routing configuration.
Thank you for considering this feature request. I look forward to your feedback.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thx useful libs.
I would like the router to be able to match and interpret parameters attached to parent paths. This would be particularly useful when using the Outlet component to manage tabs or similar features, as the
useParams
hook could be used to conveniently extract these parameters.For example, consider the scenario where an absolute route path "/setting" is nested under a parent path "/:tabKey", as illustrated in this CodeSandbox:
https://codesandbox.io/s/type-569g14?file=/demo.tsx
Currently, attempting this results in an error stating:
If React Router could be enhanced to handle this scenario without generating an error, I believe it would open up new possibilities for flexible and efficient routing configuration.
Thank you for considering this feature request. I look forward to your feedback.
Best Regards,
Beta Was this translation helpful? Give feedback.
All reactions