Optimistic Update not working on another route.
On
/vote/$senatorId I have a mutation
My problem is, getAllVotes is used in another route at /myVotes and when I navigate directly after sending the mutation, the updates dont seem to be optimistically done, only when the invalidation finishes does the data change.
If I, however, copy consume the component from /myVotes to /vote/$senatorId, I can see the optimistic updates working, but again, when navigating it does not work immediately.
I guess what I'm trying to ask is, how do I properly optimistically update data on another route?
I'm not sure if this is a tanstack-start issue or a react-query issue or if it's a react thing in general.2 Replies
plain-purple•7mo ago
Is it a client side navigation? Are you reloading the entire site?
sensitive-blueOP•7mo ago
its client side navigation
i expect the data to have been optimistically updated since its client side but its not