deny missing docs in router
This commit is contained in:
6 files changed
+71
-22
No files matched your search
@@ -10,6 +10,8 @@ use crate::{RouterError, utils::use_router_internal::use_router_internal};
|
||||
/// component calling the [`use_router`] hook.
|
||||
/// - Otherwise [`Ok`].
|
||||
///
|
||||
/// [`use_router`]: crate::hooks::use_router
|
||||
///
|
||||
/// # Panic
|
||||
/// - When the calling component is not nested within another component calling the [`use_router`]
|
||||
/// hook, but only in debug builds.
|
||||
|
||||
@@ -2,7 +2,7 @@ use async_rwlock::RwLockReadGuard;
|
||||
use dioxus::{core::Component, prelude::ScopeState};
|
||||
use dioxus_router_core::RouterState;
|
||||
|
||||
use crate::{RouterError, utils::use_router_internal::use_router_internal};
|
||||
use crate::{utils::use_router_internal::use_router_internal, RouterError};
|
||||
|
||||
/// A hook that provides access to information about the current routing location.
|
||||
///
|
||||
@@ -55,7 +55,7 @@ use crate::{RouterError, utils::use_router_internal::use_router_internal};
|
||||
/// # assert_eq!(dioxus_ssr::render(&vdom), "<h1>App</h1><h2>Current Path</h2><p>/some/path</p>")
|
||||
/// ```
|
||||
///
|
||||
/// [`use_router`]: super::use_router
|
||||
/// [`use_router`]: crate::hooks::use_router
|
||||
#[must_use]
|
||||
pub fn use_route<'a>(
|
||||
cx: &'a ScopeState,
|
||||
|
||||
@@ -27,15 +27,16 @@ use crate::{
|
||||
///
|
||||
/// # Return values
|
||||
/// This hook returns the current router state and a navigator. For more information about the
|
||||
/// state, see the [`use_route`](super::use_route) hook. For more information about the
|
||||
/// [`Navigator`], see its own documentation and the [`use_navigate`](super::use_navigate) hook.
|
||||
/// state, see the [`use_route`](crate::hooks::use_route) hook. For more information about the
|
||||
/// [`Navigator`], see its own documentation and the [`use_navigate`](crate::hooks::use_navigate)
|
||||
/// hook.
|
||||
///
|
||||
/// # Panic
|
||||
/// - When used within a component, that is nested inside another component calling [`use_router`],
|
||||
/// but only in debug builds.
|
||||
///
|
||||
/// # Example
|
||||
/// ```rust,no_run
|
||||
/// ```rust
|
||||
/// # use dioxus::prelude::*;
|
||||
/// # use dioxus_router::prelude::*;
|
||||
/// fn App(cx: Scope) -> Element {
|
||||
@@ -129,7 +130,7 @@ pub fn use_router<'a>(
|
||||
/// Global configuration options for the router.
|
||||
///
|
||||
/// This implements [`Default`], so you can use it like this:
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use dioxus_router::prelude::RouterConfiguration;
|
||||
/// let cfg = RouterConfiguration {
|
||||
/// synchronous: false,
|
||||
|
||||
Reference in new issue
Block a user