remove cx.render

This commit is contained in:
Jonathan Kelley committed 2024-01-13 21:12:21 -08:00
1 parent fae0b08e61
commit 1dde044697
159 files changed
+600 -658

No files matched your search

+4 -4
View File
@@ -3,7 +3,7 @@ use dioxus_web::Config;
use web_sys::window;
fn app() -> Element {
cx.render(rsx! {
rsx! {
div { h1 { "thing 1" } }
div { h2 { "thing 2" } }
div {
@@ -17,12 +17,12 @@ fn app() -> Element {
"thing {f}"
}
})}
})
}
}
#[allow(non_snake_case)]
fn Bapp() -> Element {
cx.render(rsx! {
rsx! {
div { h1 { "thing 1" } }
div { h2 { "thing 2" } }
div {
@@ -30,7 +30,7 @@ fn Bapp() -> Element {
"asd"
"asd"
}
})
}
}
fn main() {
+4 -4
View File
@@ -6,8 +6,8 @@ fn main() {
}
fn app() -> Element {
let count = use_ref(|| 0);
let started = use_state(|| false);
let count = use_signal(|| 0);
let started = use_signal(|| false);
let start = move || {
if !*started.get() {
@@ -18,7 +18,7 @@ fn app() -> Element {
started.set(true); // this cannot be done inside condition or infinite loop
};
cx.render(rsx! {
rsx! {
button {
onclick: move |_event| {
start();
@@ -30,5 +30,5 @@ fn app() -> Element {
"Start"
}
}
})
}
}
+1 -1
View File
@@ -127,7 +127,7 @@ pub fn launch(root_component: fn() -> Element) {
/// }
///
/// fn app() -> Element {
/// cx.render(rsx!{
/// rsx!{
/// h1 {"hello world!"}
/// })
/// }
+2 -2
View File
@@ -8,7 +8,7 @@ wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
#[test]
fn makes_tree() {
fn app() -> Element {
cx.render(rsx! {
rsx! {
div {
div {
h1 {}
@@ -29,7 +29,7 @@ fn makes_tree() {
#[wasm_bindgen_test]
fn rehydrates() {
fn app() -> Element {
cx.render(rsx! {
rsx! {
div {
div {
h1 { "h1" }