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
I'm trying to implement an optimistic update with useSWRMutation.
For some reason the data doesn't change optimistically. It is waiting for the fetcher resolve and then changes. optimisticData is called, but it doesn't do anything.
Expected Behavior
Please see the attached example. data should change rightaway to true when the button is clicked, but it is still undefined until the promise resolves.
Bug report
Description / Observed Behavior
I'm trying to implement an optimistic update with useSWRMutation.
For some reason the data doesn't change optimistically. It is waiting for the fetcher resolve and then changes.
optimisticData
is called, but it doesn't do anything.Expected Behavior
Please see the attached example.
data
should change rightaway totrue
when the button is clicked, but it is stillundefined
until the promise resolves.Repro Steps / Code Example
https://codesandbox.io/p/sandbox/hopeful-bouman-cr27yt
Additional Context
SWR version: 2.2.5.
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: