Replies: 1 comment
-
Hmm.. I think a primitive could be built here pretty easily. However, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is feature request, I want
createResource
have an option which disables integration with suspense, making it regular async fetching utility.My use case:
I have toplevel
Suspense
boundary wrapping router pages.Using route data function I fetch all of the list ids' from indexeddb async using
createResource
.Now inside actual page there is virtual list taking that flat id list, each list item then fetches their own data as they need.
As it is right now I can't use
createResource
inside list items, because after initial load and because virtual list recycles nodes, fetching new data would retrigger top level page load indicators, flashing if not used withstartTransition
, I tried usingSuspenseList
, but because it relies on element ordering, that also has issues like click handlers not working if list is scrolled. Overall it wouldn't even be great fit to use suspense inside each list item even if I wasn't facing issues like that.createResource
already has great functionality for async data loading, so it would be nice if it could also be repurposed as generic data loading tool, not only when using suspense.Beta Was this translation helpful? Give feedback.
All reactions