fix test failures
This commit is contained in:
1 parent
aaded7981f
commit
e43bdd815f
5 files changed
+20
-7
No files matched your search
@@ -88,15 +88,18 @@ pub trait HistoryProvider<R: Routable> {
|
||||
/// # use dioxus::prelude::*;
|
||||
/// # #[inline_props]
|
||||
/// # fn Index(cx: Scope) -> Element { todo!() }
|
||||
/// # fn Other(cx: Scope) -> Element { todo!() }
|
||||
/// #[derive(Clone, Routable, Debug, PartialEq)]
|
||||
/// enum Route {
|
||||
/// #[route("/")]
|
||||
/// Index {},
|
||||
/// #[route("/other")]
|
||||
/// Other {},
|
||||
/// }
|
||||
/// let mut history = MemoryHistory::<Route>::default();
|
||||
/// assert_eq!(history.can_go_back(), false);
|
||||
///
|
||||
/// history.push(Route::Index {});
|
||||
/// history.push(Route::Other {});
|
||||
/// assert_eq!(history.can_go_back(), true);
|
||||
/// ```
|
||||
#[must_use]
|
||||
|
||||
@@ -34,7 +34,7 @@ use crate::utils::use_router_internal::use_router_internal;
|
||||
///
|
||||
/// #[inline_props]
|
||||
/// fn Index(cx: Scope) -> Element {
|
||||
/// let path = use_route(&cx).unwrap();
|
||||
/// let path: Route = use_route(&cx).unwrap();
|
||||
/// render! {
|
||||
/// h2 { "Current Path" }
|
||||
/// p { "{path}" }
|
||||
|
||||
@@ -162,9 +162,9 @@ pub trait Routable: std::fmt::Display + std::str::FromStr + Clone + 'static {
|
||||
///
|
||||
/// #[derive(Routable, Clone, PartialEq, Debug)]
|
||||
/// enum Route {
|
||||
/// #[route("/")]
|
||||
/// #[route("/home")]
|
||||
/// Home {},
|
||||
/// #[route("/about")]
|
||||
/// #[route("/home/about")]
|
||||
/// About {},
|
||||
/// }
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user