1
2
3
4
5
6
7
8
9
10
11
use dioxus::prelude::ScopeState;

use crate::{prelude::RouterContext, utils::use_router_internal::use_router_internal};

#[deprecated = "prefer the use_navigator or use_route functions"]
/// A hook that provides access to information about the router.
pub fn use_router(cx: &ScopeState) -> &RouterContext {
    use_router_internal(cx)
        .as_ref()
        .expect("use_route must have access to a router")
}