swr icon indicating copy to clipboard operation
swr copied to clipboard

reValidateOnMount doesn't work when component is unmounted while the data is being fetched

Open sibasishm opened this issue 1 year ago • 1 comments

Bug report

Description / Observed Behavior

Unmounting the component while the data is being fetched i.e; isValidating is true, doesn't trigger refetch on the next mount, even if reValidateOnMount is set to true.

Expected Behavior

Refetch should happen on each mount if reValidateOnMount is set to true.

Additional Context

  • Version: 0.5.6
  • Framework: React Native

sibasishm avatar Jul 21 '22 12:07 sibasishm

@sibasishm Could you reproduce it on CodeSandbox? Updating the SWR version might fix your issue.

koba04 avatar Jul 24 '22 03:07 koba04