fix: Update dioxus-router docs

This commit is contained in:
marc2332 committed 2024-02-26 21:46:00 +01:00
1 parent 451a8f231e
commit d3b9b764e0
3 files changed
+6 -10

No files matched your search

+2 -6
View File
@@ -5,12 +5,8 @@ use crate::utils::use_router_internal::use_router_internal;
///
/// > The Routable macro will define a version of this hook with an explicit type.
///
/// # Return values
/// - None, when not called inside a [`Link`] component.
/// - Otherwise the current route.
///
/// # Panic
/// - When the calling component is not nested within a [`Link`] component during a debug build.
/// - When the calling component is not nested within a [`Router`] component.
///
/// # Example
/// ```rust
@@ -49,7 +45,7 @@ pub fn use_route<R: Routable + Clone>() -> R {
match use_router_internal() {
Some(r) => r.current(),
None => {
panic!("`use_route` must have access to a parent router")
panic!("`use_route` must be called in a descendant of a Router component")
}
}
}