Function use_router

Source
pub fn use_router<'hook>() -> impl 'hook + Hook<Output = Router>
Expand description

A hook to access the Router instance.

This hook allows components to access the router, which manages the application’s navigation and routes. It retrieves the router from the current context and returns it.

§Note

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

pub fn use_router() -> Router {
    /* implementation omitted */
}