remove cx.render
This commit is contained in:
159 files changed
+600
-658
No files matched your search
@@ -1,8 +1,8 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn app() -> Element {
|
||||
let state = use_state(|| 0);
|
||||
use_future((), |_| {
|
||||
let state = use_signal(|| 0);
|
||||
use_future(|_| {
|
||||
to_owned![state];
|
||||
async move {
|
||||
loop {
|
||||
@@ -12,7 +12,7 @@ fn app() -> Element {
|
||||
}
|
||||
});
|
||||
|
||||
cx.render(rsx! {
|
||||
rsx! {
|
||||
button {
|
||||
onclick: move |_| {
|
||||
state.set(0);
|
||||
@@ -24,7 +24,7 @@ fn app() -> Element {
|
||||
"hello desktop! {state}"
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -52,7 +52,7 @@ fn mock_event(id: &'static str, value: &'static str) {
|
||||
#[allow(deprecated)]
|
||||
fn app() -> Element {
|
||||
let desktop_context: DesktopContext = cx.consume_context().unwrap();
|
||||
let received_events = use_state(|| 0);
|
||||
let received_events = use_signal(|| 0);
|
||||
|
||||
// button
|
||||
mock_event(
|
||||
|
||||
@@ -29,7 +29,7 @@ fn main() {
|
||||
fn use_inner_html(d: &'static str) -> Option<String> {
|
||||
let eval_provider = use_eval(cx);
|
||||
|
||||
let value: &UseRef<Option<String>> = use_ref(|| None);
|
||||
let value: Signal<Option<String>> = use_signal(|| None);
|
||||
use_effect((), |_| {
|
||||
to_owned![value, eval_provider];
|
||||
async move {
|
||||
|
||||
@@ -18,7 +18,7 @@ use tao::event::{Event, StartCause, WindowEvent};
|
||||
/// }
|
||||
///
|
||||
/// fn app() -> Element {
|
||||
/// cx.render(rsx!{
|
||||
/// rsx!{
|
||||
/// h1 {"hello world!"}
|
||||
/// })
|
||||
/// }
|
||||
@@ -42,7 +42,7 @@ pub fn launch(root: Component) {
|
||||
/// }
|
||||
///
|
||||
/// fn app() -> Element {
|
||||
/// cx.render(rsx!{
|
||||
/// rsx!{
|
||||
/// h1 {"hello world!"}
|
||||
/// })
|
||||
/// }
|
||||
@@ -71,7 +71,7 @@ pub fn launch_cfg(root: Component, config_builder: Config) {
|
||||
/// }
|
||||
///
|
||||
/// fn app(cx: Scope<AppProps>) -> Element {
|
||||
/// cx.render(rsx!{
|
||||
/// rsx!{
|
||||
/// h1 {"hello {cx.props.name}!"}
|
||||
/// })
|
||||
/// }
|
||||
|
||||
@@ -35,7 +35,7 @@ fn main() {
|
||||
}
|
||||
|
||||
fn app() -> Element {
|
||||
cx.render(rsx!{
|
||||
rsx!{
|
||||
div {
|
||||
"hello world!"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user