pub fn use_router<'hook, T>(
) -> impl 'hook + Hook<Output = Option<RouterContext<T>>>
where T: Target + 'static + 'hook,
Expand description

Get access to the router.

The hook requires to be called from a component which is nested into a Router component of the type T provided here. If not, it will return None.

§Note

When used in function components and hooks, this hook is equivalent to:

pub fn use_router<T>() -> Option<RouterContext<T>>
where
    T: Target + 'static,
{
    /* implementation omitted */
}