pub fn use_route<'hook>() -> impl 'hook + Hook<Output = Cow<'static, str>>
Expand description
A hook to access the current route path with the basename stripped.
This hook is useful for components that need the current route path with the basename removed.
It uses the use_router
and use_location
hooks to get the router and location information,
then strips the basename from the location path, returning the stripped path as a Cow<'static, str>
.
ยงNote
When used in function components and hooks, this hook is equivalent to:
pub fn use_route() -> Cow<'static, str> {
/* implementation omitted */
}