Merge pull request #1324 from ealmloff/bool-attrs-ssr

Fix boolean attribute rendering in SSR
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2023-09-16 12:01:52 -07:00
commit 9c300ff266
6 files changed
+139 -26

No files matched your search

+4 -1
View File
@@ -88,15 +88,18 @@ pub trait HistoryProvider<R: Routable> {
/// # use dioxus::prelude::*;
/// # #[component]
/// # 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]
+1 -1
View File
@@ -35,7 +35,7 @@ use crate::utils::use_router_internal::use_router_internal;
///
/// #[component]
/// fn Index(cx: Scope) -> Element {
/// let path = use_route(&cx).unwrap();
/// let path: Route = use_route(&cx).unwrap();
/// render! {
/// h2 { "Current Path" }
/// p { "{path}" }
+2 -2
View File
@@ -226,9 +226,9 @@ pub trait Routable: FromStr + Display + Clone + 'static {
///
/// #[derive(Routable, Clone, PartialEq, Debug)]
/// enum Route {
/// #[route("/")]
/// #[route("/home")]
/// Home {},
/// #[route("/about")]
/// #[route("/home/about")]
/// About {},
/// }
///