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:
@ -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!
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user