mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 06:08:26 +00:00
simplify fullstack hello world examples
This commit is contained in:
parent
6ade4767e6
commit
f55375b8ce
3 changed files with 6 additions and 24 deletions
|
@ -22,14 +22,8 @@ fn app(cx: Scope<AppProps>) -> Element {
|
|||
}
|
||||
|
||||
fn Child(cx: Scope) -> Element {
|
||||
let state = use_server_future(cx, (), |()| async move {
|
||||
loop {
|
||||
if let Ok(res) = get_server_data().await {
|
||||
break res;
|
||||
}
|
||||
}
|
||||
})?
|
||||
.value();
|
||||
let state =
|
||||
use_server_future(cx, (), |()| async move { get_server_data().await.unwrap() })?.value();
|
||||
|
||||
let mut count = use_state(cx, || 0);
|
||||
let text = use_state(cx, || "...".to_string());
|
||||
|
|
|
@ -22,14 +22,8 @@ fn app(cx: Scope<AppProps>) -> Element {
|
|||
}
|
||||
|
||||
fn Child(cx: Scope) -> Element {
|
||||
let state = use_server_future(cx, (), |()| async move {
|
||||
loop {
|
||||
if let Ok(res) = get_server_data().await {
|
||||
break res;
|
||||
}
|
||||
}
|
||||
})?
|
||||
.value();
|
||||
let state =
|
||||
use_server_future(cx, (), |()| async move { get_server_data().await.unwrap() })?.value();
|
||||
|
||||
let mut count = use_state(cx, || 0);
|
||||
let text = use_state(cx, || "...".to_string());
|
||||
|
|
|
@ -22,14 +22,8 @@ fn app(cx: Scope<AppProps>) -> Element {
|
|||
}
|
||||
|
||||
fn Child(cx: Scope) -> Element {
|
||||
let state = use_server_future(cx, (), |()| async move {
|
||||
loop {
|
||||
if let Ok(res) = get_server_data().await {
|
||||
break res;
|
||||
}
|
||||
}
|
||||
})?
|
||||
.value();
|
||||
let state =
|
||||
use_server_future(cx, (), |()| async move { get_server_data().await.unwrap() })?.value();
|
||||
|
||||
let mut count = use_state(cx, || 0);
|
||||
let text = use_state(cx, || "...".to_string());
|
||||
|
|
Loading…
Add table
Reference in a new issue