remove cx.render
This commit is contained in:
159 files changed
+600
-658
No files matched your search
@@ -227,5 +227,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// wait 1 second
|
||||
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -171,5 +171,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// wait 1 second
|
||||
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -218,5 +218,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// wait 1 second
|
||||
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ impl State for Border {
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
fn app() -> Element {
|
||||
let count = use_state(|| 0);
|
||||
let count = use_signal(|| 0);
|
||||
|
||||
use_future((count,), |(count,)| async move {
|
||||
loop {
|
||||
@@ -176,7 +176,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
});
|
||||
|
||||
cx.render(rsx! {
|
||||
rsx! {
|
||||
div{
|
||||
color: "red",
|
||||
"{count}",
|
||||
@@ -186,7 +186,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
|
||||
fn Comp() -> Element {
|
||||
cx.render(rsx! {
|
||||
rsx! {
|
||||
div{
|
||||
border: "",
|
||||
"hello world"
|
||||
@@ -245,5 +245,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
println!("{indent}{id:?} {color:?} {size:?} {border:?} {node_type:?}");
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -257,13 +257,13 @@ impl CustomElement for CustomElementWithNoSlot {
|
||||
#[test]
|
||||
fn custom_elements_work() {
|
||||
fn app() -> Element {
|
||||
let count = use_state(|| 0);
|
||||
let count = use_signal(|| 0);
|
||||
|
||||
use_future!(|count| async move {
|
||||
use_future(|count| async move {
|
||||
count.with_mut(|count| *count += 1);
|
||||
});
|
||||
|
||||
cx.render(rsx! {
|
||||
rsx! {
|
||||
customelementslot {
|
||||
size: "{count}",
|
||||
color: "1",
|
||||
@@ -334,7 +334,7 @@ fn custom_elements_work() {
|
||||
#[should_panic]
|
||||
fn slotless_custom_element_cant_have_children() {
|
||||
fn app() -> Element {
|
||||
cx.render(rsx! {
|
||||
rsx! {
|
||||
customelementnoslot {
|
||||
testing132 {}
|
||||
}
|
||||
@@ -363,7 +363,7 @@ fn slotless_custom_element_cant_have_children() {
|
||||
#[test]
|
||||
fn slotless_custom_element() {
|
||||
fn app() -> Element {
|
||||
cx.render(rsx! {
|
||||
rsx! {
|
||||
customelementnoslot {
|
||||
}
|
||||
})
|
||||
|
||||
@@ -97,8 +97,8 @@ fn native_core_is_okay() {
|
||||
use std::time::Duration;
|
||||
|
||||
fn app() -> Element {
|
||||
let colors = use_state(|| vec!["green", "blue", "red"]);
|
||||
let padding = use_state(|| 10);
|
||||
let colors = use_signal(|| vec!["green", "blue", "red"]);
|
||||
let padding = use_signal(|| 10);
|
||||
|
||||
use_effect(colors, |colors| async move {
|
||||
sleep(Duration::from_millis(1000)).await;
|
||||
@@ -120,7 +120,7 @@ fn native_core_is_okay() {
|
||||
let _mid = colors[1];
|
||||
let _small = colors[2];
|
||||
|
||||
cx.render(rsx! {
|
||||
rsx! {
|
||||
blabla {}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user