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
Is your feature request related to a problem? Please describe.
The Leptos 0.7 Release Notes shows:
let user = Resource::new(|| (), |_| user_id());let posts = Resource::new(move || user.get(),move |_| asyncmove{let user = user.await?;get_posts(user).await},);view!{
<Suspense>
...
However, this causes Leptos to throw warnings in development mode - which may obscure warnings that a developer would need to see.
Putting the Resource definitions in a <Suspense> causes hydration issues.
Using .track() rather than .get() also doesn't work, because Resources are memoized.
Describe the solution you'd like
Either squelch warnings emitted while using this pattern. Or, allow .track() to be sufficient within the source function. Maybe, there could be a different Resource generating function that doesn't require unique return values from the source function for memoization.
Describe alternatives you've considered
I guess I could return a random value from the source function...
The text was updated successfully, but these errors were encountered:
The correct answer here in the short term is definitely just to suppress the false-positive warning. (My reading of the issue is that the example in the release notes works as expected, but issues a warning, which is why I say "false positive." Let me know if this is incorrect.)
In the medium-to-long term removing the memoization in resources so that .track() can work may be the right idea (the current API has generated some confusion, see e.g., #3308), but it would be a breaking change so couldn't happen until 0.8 in any case.
I'm interested in contributing. Though my time is very limited. I'm also hoping to reproduce some errors for other tickets.
I use Leptos at work - and right now, management is much more interested in getting new features delivered. So, I've been prioritizing finding workarounds for issues as they come up. I got things working well enough that I merged my migration into main.
Maybe I can get some work done for Leptos itself this weekend.
Is your feature request related to a problem? Please describe.
The Leptos 0.7 Release Notes shows:
However, this causes Leptos to throw warnings in development mode - which may obscure warnings that a developer would need to see.
Putting the Resource definitions in a
<Suspense>
causes hydration issues.Using
.track()
rather than.get()
also doesn't work, because Resources are memoized.Describe the solution you'd like
Either squelch warnings emitted while using this pattern. Or, allow
.track()
to be sufficient within thesource
function. Maybe, there could be a different Resource generating function that doesn't require unique return values from thesource
function for memoization.Describe alternatives you've considered
I guess I could return a random value from the
source
function...The text was updated successfully, but these errors were encountered: