Hello 👋 ,
I have a component which looks like the following:
#[function_component(Entries)]
pub fn entries(props: &EntriesProps) -> HtmlResult {
let results = use_state(|| None);
let input = props.input.clone();
{
let input_clone = input.clone();
let results = results.clone();
use_effect_with(input, move |_| {
let input_clone_clone = input_clone.clone();
wasm_bindgen_futures::spawn_local(async move {
let res = search(input_clone_clone.as_deref()).await;
results.set(Some(res));
});
|| {}
});
}
let html = // ...
Ok(html)
}
However, I would like to benefit from Suspense and use use_future_with but can't seem to figure out how since it doesn't seem to hook into the component lifecycle.