fix: Update dioxus-router docs
This commit is contained in:
3 files changed
+6
-10
No files matched your search
@@ -8,10 +8,10 @@ use crate::prelude::*;
|
||||
/// single component, but not recommended. Multiple subscriptions will be discarded.
|
||||
///
|
||||
/// # Return values
|
||||
/// - [`None`], when the current component isn't a descendant of a [`Link`] component.
|
||||
/// - [`None`], when the current component isn't a descendant of a [`Router`] component.
|
||||
/// - Otherwise [`Some`].
|
||||
pub(crate) fn use_router_internal() -> Option<RouterContext> {
|
||||
let router = use_hook(consume_context::<RouterContext>);
|
||||
let router = try_consume_context::<RouterContext>()?;
|
||||
let id = current_scope_id().expect("use_router_internal called outside of a component");
|
||||
use_drop({
|
||||
to_owned![router];
|
||||
|
||||
Reference in new issue
Block a user