use_resource is the correct thing to use.

The top components can use_resource and be properly setup during
hydration. The sub components need to use_server_resource so that they
can be hydrated later.
This commit is contained in:
2025-10-10 00:26:17 -04:00
parent e49ecbac4d
commit 1a82e856d9
3 changed files with 4 additions and 4 deletions

2
Cargo.lock generated
View File

@ -297,7 +297,7 @@ dependencies = [
[[package]]
name = "bard"
version = "0.3.10"
version = "0.3.11"
dependencies = [
"dioxus",
"tavern",

View File

@ -1,6 +1,6 @@
[package]
name = "bard"
version = "0.3.10"
version = "0.3.11"
edition = "2024"
description = "Dioxus components that will display a Tavern blogging system Blog."
repository = "/CyberMages/tavern"

View File

@ -80,13 +80,13 @@ pub fn BlogList(tags: Signal<HashSet<String>>, children: Element) -> Element
// Retrieve the provided settings from context.
let settings = use_context::<BardSettings>();
let list = use_server_future(move ||
let list = use_resource(move ||
{
let tags = tags();
let categories: Vec<String> = tags.iter().cloned().collect();
async move { get_blog_list(categories).await }
})?;
});
rsx!
{