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
In my usage of the useSWRImmutable hook, my component has a dynamic key as state. Upon an update to this key, I expected an immediate isLoading == true (assuming that the key is brand new) as there's no cached data associated with it. Instead, there's a split second where isLoading is false before loading as normal. I've narrowed this down to the revalidateIfStale option.
Expected Behavior
When revalidateIfStale is false, the first time a key is encountered should immediately set isLoading to true as there's no stale data.
Repro Steps / Code Example
Here's a CodeSandbox of the issue. You can see the unexpected state logged in the console.
The text was updated successfully, but these errors were encountered:
Bug report
Description / Observed Behavior
In my usage of the
useSWRImmutable
hook, my component has a dynamic key as state. Upon an update to this key, I expected an immediateisLoading == true
(assuming that the key is brand new) as there's no cached data associated with it. Instead, there's a split second whereisLoading
is false before loading as normal. I've narrowed this down to therevalidateIfStale
option.Expected Behavior
When
revalidateIfStale
is false, the first time a key is encountered should immediately setisLoading
to true as there's no stale data.Repro Steps / Code Example
Here's a CodeSandbox of the issue. You can see the unexpected state logged in the console.
The text was updated successfully, but these errors were encountered: