swrv icon indicating copy to clipboard operation
swrv copied to clipboard

useSWRV does not revalidate if you call `mutate` and render another component right after

Open edumudu opened this issue 2 years ago • 0 comments

First of all, great lib, thanks

If you call the global mutate method and right after render a component that uses useSRWV, the cache is not revalidated

repro codesandbox

Steps To test

  • click on the button "go to Route 2"
  • click on the button "Change cache"
  • click on the button "go to Route 1"

if you open the browser dev tools and go to the networks tab you will see that the request to revalidate is not requested. If you wait a while in the Route 2 before go to Route 1, works fine

edumudu avatar Mar 31 '22 03:03 edumudu