react-router
react-router copied to clipboard
[Docs]: Document useParams return key for wildcard param (*)
What is the new or updated feature that you are suggesting?
Add documentation for how to access the wildcard value in a route when using useParams.
Example:
// ex: `/articles/:id/*`;
// url - `/articles/1/tab/path`
const {*, id} = useParams();
// * = 'tab/path'
//or
const params = useParams();
console.log(params['*']);
// * = 'tab/path'
Why should this feature be included?
It is not clear that a param without a : will be part of the useParams return object. It seems like a special case that would be helpful to document. This could also be helpful to track if this changes and how to migrate to/from.
Thanks!
Sorry folks, our stale bot went rogue and closed this 😅