You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A create_local_resource inside an island does not re-run the fetcher when the source signal changes, in Leptos 6.0 beta versions (so far).
In this reproduction, you can see that the signal when routed through the LocalResourceTest ServerFn, does not re-run and match the signal itself. It remains blank, as it only appears to run the fetcher on initial load.
To Reproduce
use leptos::*;#[server(LocalResourceTest, "/api")]pubasyncfnlocal_resource_test(input:String) -> Result<String,ServerFnError>{Ok(input)}#[component]pubfnTest() -> implIntoView{view!{ <TestIsland/> }}#[island]pubfnTestIsland() -> implIntoView{let(input, set_input) = create_signal("".to_string());let local_resource_test = create_local_resource(move || input(),move |input| local_resource_test(input));view!{
<input style="border: 1px solid black;"type="text" on:input=move |ev| { set_input(event_target_value(&ev))}/>
<div>
<Transition fallback=move || ()>
{move || match local_resource_test.get(){Some(Ok(result)) => format!("Here is the response from the local resource: {}", result),
_ => "".to_string(),
}}
</Transition>
</div>
{move || format!("Here is the input signal, so you can see it does update and change and should trigger the re-fetch: {}", input())}}}
The text was updated successfully, but these errors were encountered:
I’m on my phone because my computer is being used to watch Moana for the 100th time, but if you want to try a local patch or make a PR: leptos_reactive/src/resource.rs needs a source.track() inserted at line 388, just before r.load(). When I fixed #2221 I missed adding the tracking back here in addition to the other helper for resources.
Describe the bug
A create_local_resource inside an island does not re-run the fetcher when the source signal changes, in Leptos 6.0 beta versions (so far).
It was previously working on Leptos 5.5 (3f34d9b)
In this reproduction, you can see that the signal when routed through the LocalResourceTest ServerFn, does not re-run and match the signal itself. It remains blank, as it only appears to run the fetcher on initial load.
To Reproduce
The text was updated successfully, but these errors were encountered: