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
isLoading / isValidating values are incorrect when fallback or fallback data is set and can cause infinite loading issue after disabling revalidation options.
Expected Behavior
IsLoading and isValidation should be only set to true when there is ongoing request:
isValidating becomes true whenever there is an ongoing request whether the data is loaded or not
isLoading becomes true when there is an ongoing request and data is not loaded yet.
in the case below we dont have ongoing requests and we have data loaded (from fallback) so isLoading and isValidating values should be false.
…ed (#2382)
* fix: initial loading state should be false with revalidation is disabled with fallbackData
close#2369
* chore: dont read external data in useMemo
Bug report
Description / Observed Behavior
isLoading / isValidating values are incorrect when fallback or fallback data is set and can cause infinite loading issue after disabling revalidation options.
Expected Behavior
IsLoading and isValidation should be only set to true when there is ongoing request:
in the case below we dont have ongoing requests and we have data loaded (from fallback) so isLoading and isValidating values should be false.
Repro Steps / Code Example
https://codesandbox.io/s/cranky-wright-xg4kpv?file=/src/App.js
Additional Context
SWR version.
2.0.1
The text was updated successfully, but these errors were encountered: