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 am using swr with object keys to fetch a data source which can be updated in backend and I am giving users an ability to manually refresh. I've been using SWR's mutation features to implement it. The mutate function from useSWR return does not update the state, while the trigger function from useSWRMutation updates it. However, both calls are firing network requests.
Note in my use case the key did not change and I am just running an manual refresh.
isLoading is only updated during initial loading, so in this case, isValidating would be what you expect.
In your example, data returned from useSWR is not being accessed, so re-rendering doesn't happen.
isLoading is only updated during initial loading, so in this case, isValidating would be what you expect. In your example, data returned from useSWR is not being accessed, so re-rendering doesn't happen.
Bug report
Description / Observed Behavior
I am using swr with object keys to fetch a data source which can be updated in backend and I am giving users an ability to manually refresh. I've been using SWR's mutation features to implement it. The
mutate
function fromuseSWR
return does not update the state, while thetrigger
function fromuseSWRMutation
updates it. However, both calls are firing network requests.Note in my use case the key did not change and I am just running an manual refresh.
Expected Behavior
Both calls should update state
Repro Steps / Code Example
See https://stackblitz.com/edit/vitejs-vite-fvuflg?file=src%2FApp.jsx
Additional Context
SWR version: * || ^2.2.5
The text was updated successfully, but these errors were encountered: