more fullstack cleanups: loaders serialize, ServeConfig only (#4785)

* some opinionated cleanups in dioxus-server

* add serialize to loader

* add `result` to Resource

* clippy

* fix

* writable memos, resources, `onmount`, `.pending`, and `.value()` on actions

* fix compile issues

* fix typo
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-10-14 17:34:52 -07:00
1 parent a3e40a5ea2
commit 7102bc3b6a
33 files changed
+2085 -672

No files matched your search

+2 -2
View File
@@ -36,12 +36,12 @@ fn Home() -> Element {
}
#[component]
fn Post(id: u32) -> Element {
fn Post(id: ReadSignal<u32>) -> Element {
// You can return `HttpError` to return a specific HTTP status code and message.
// `404 Not Found` will cause the server to return a 404 status code.
//
// `use_loader` will suspend the server-side rendering until the future resolves.
let post_data = use_loader(move || get_post(id))?;
let post_data = use_loader(move || get_post(id()))?;
rsx! {
h1 { "Post {id}" }