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
When using mutate from useSWR<User>, the async function I have to pass must return User as well. This makes me have to do a bit more in my api. For example: my useUpdateUser hook didn't return anything because it didn't need to. I had to update it to return the user. I do this in different parts of my application where it takes a bit more to return the required type.
Expected Behavior
If you have populateCache: false then it's not needed to return the User type since I don't intend on updating the cache.
Bug report
Description / Observed Behavior
When using mutate from
useSWR<User>
, the async function I have to pass must returnUser
as well. This makes me have to do a bit more in my api. For example: myuseUpdateUser
hook didn't return anything because it didn't need to. I had to update it to return the user. I do this in different parts of my application where it takes a bit more to return the required type.Expected Behavior
If you have
populateCache: false
then it's not needed to return theUser
type since I don't intend on updating the cache.Repro Steps / Code Example
Additional Context
SWR version:
^1.2.0-beta.0
The text was updated successfully, but these errors were encountered: