serialize data in the server and deserialize data in the client

This commit is contained in:
Evan Almloff committed 2024-02-02 17:23:00 -06:00
1 parent 8b489db5ac
commit 1c4e1d84ea
5 files changed
+26 -23

No files matched your search

@@ -17,5 +17,5 @@ reqwest = "0.11.18"
[features]
default = []
ssr = ["dioxus/axum"]
server = ["dioxus/axum"]
web = ["dioxus/web"]
@@ -11,6 +11,7 @@ use serde::{Deserialize, Serialize};
fn app() -> Element {
let mut count = use_signal(|| 0);
let text = use_signal(|| "...".to_string());
let server_future = use_server_future(get_server_data)?;
rsx! {
h1 { "High-Five counter: {count}" }
@@ -30,6 +31,7 @@ fn app() -> Element {
"Run a server function!"
}
"Server said: {text}"
"{server_future.state():?}"
}
}