dioxus-fullstack-hooks

Crates.iodioxus-fullstack-hooks
lib.rsdioxus-fullstack-hooks
version0.7.0-rc.0
created_at2025-05-14 07:20:45.792768+00
updated_at2025-08-11 22:43:43.372394+00
descriptionHooks for serializing futures, values in dioxus-fullstack and other utilities
homepagehttps://dioxuslabs.com
repositoryhttps://github.com/DioxusLabs/dioxus/
max_upload_size
id1672993
size40,341
Jonathan Kelley (jkelleyrtp)

documentation

README

Dioxus Fullstack Hooks

Dioxus fullstack hooks provides hooks and contexts for dioxus-fullstack. Libraries that need to integrate with dioxus-fullstack should rely on this crate instead of the renderer for quicker build times.

Usage

To start using this crate, you can run the following command:

cargo add dioxus-fullstack-hooks

Then you can use hooks like use_server_future in your components:

use dioxus::prelude::*;
async fn fetch_article(id: u32) -> String {
    format!("Article {}", id)
}

fn App() -> Element {
    let mut article_id = use_signal(|| 0);
    // `use_server_future` will spawn a task that runs on the server and serializes the result to send to the client.
    // The future will rerun any time the
    // Since we bubble up the suspense with `?`, the server will wait for the future to resolve before rendering
    let article = use_server_future(move || fetch_article(article_id()))?;

    rsx! {
        "{article().unwrap()}"
    }
}
Commit count: 6674

cargo fmt