depreciate the render macro

This commit is contained in:
Evan Almloff committed 2024-01-16 13:18:46 -06:00
1 parent 90d0164b9e
commit e65c5f0eb3
148 files changed
+459 -458

No files matched your search

+5 -5
View File
@@ -2,7 +2,7 @@
//! Suspense in Dioxus
//!
//! Currently, `render!` does not accept futures as values. To achieve the functionality
//! Currently, `rsx!` does not accept futures as values. To achieve the functionality
//! of suspense, we need to make a new component that performs its own suspense
//! handling.
//!
@@ -29,7 +29,7 @@ fn main() {
}
fn app() -> Element {
render! {
rsx! {
div {
h1 { "Dogs are very important" }
p {
@@ -64,11 +64,11 @@ fn Doggo() -> Element {
});
match fut.value().read().as_ref() {
Some(Ok(resp)) => render! {
Some(Ok(resp)) => rsx! {
button { onclick: move |_| fut.restart(), "Click to fetch another doggo" }
div { img { max_width: "500px", max_height: "500px", src: "{resp.message}" } }
},
Some(Err(_)) => render! { div { "loading dogs failed" } },
None => render! { div { "loading dogs..." } },
Some(Err(_)) => rsx! { div { "loading dogs failed" } },
None => rsx! { div { "loading dogs..." } },
}
}