Replies: 1 comment
-
you cannot refetch a single page within an infinite query, so you have to either write directly to the cache or invalidate the whole list (all pages) |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I have a view similar to the one shown below. I am having some difficulty figuring out the best approach to revalidating data on an update. The
ItemList
needs to render a bunch of items and make use of infinite scrolling. When clicking on a single item it renders theItemDetails
on the right. These details are editable and when the user hits save I need to invalidate the appropriate query to reflect the update both on theItemDetails
view as well as the singleItem
in theItemList
. From what I can gather in the docs it looks like theuseInfiniteQuery
hook is my best bet. However when the update occurs is it best to revalidate everything so all items are refreshed or only the single page in which the updated item resides? Not sure what the best way to do this is or if there is a better approach. Any advice is appreciated 🙏Beta Was this translation helpful? Give feedback.
All reactions