Component outside view not optimistically updating #8059
Unanswered
antonycaporossi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I am still a beginner so I apologize in advance.
I have a set of items that can be added to favorites via the FavoriteButton component.
I am using React Query to synchronize this with the database.
FavoriteButton
useFavorites
useFavoritesMutations
When i load the page i can add the items to favoriteList without problems.
If I scroll down the page and new items are mounted then the button stops working.
The database receives the data and inserts the data but the button does not change state since here
old
is undefined for those items and so the cache not getting updated.I hope I have explained myself well.
What could be the cause? Am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions