How would I do that?
Like having a reFetch button or something?
Every useSWR call gives you a mutate function along the data and error objects, you can use it to mutate the data of that call or calling it without arguments to trigger a revalidation, that means SWR will fetch the data again and update the component with the new one.
Like for example a reFetch button when request fails. Does above solution work for this use case?
Actually SWR automatically retries after a Fetch error, but yes, that use cause could be solved using mutate
Thank you馃帀馃帄
Most helpful comment
Every useSWR call gives you a mutate function along the data and error objects, you can use it to mutate the data of that call or calling it without arguments to trigger a revalidation, that means SWR will fetch the data again and update the component with the new one.