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
Following from vercel/swr#1574 and vercel/swr#1816, the shouldRetryOnError option can accept a function to conditionally determine if SWR should retry. The notes for Release 1.2.1 provide a basic usage example copied here.
useSWR(key,fetcher,{shouldRetryOnError: (error)=>{// We skip retrying if the API is returning 404:if(error.status===404)returnfalsereturntrue}})
Following from vercel/swr#1574 and vercel/swr#1816, the
shouldRetryOnError
option can accept a function to conditionally determine if SWR should retry. The notes for Release 1.2.1 provide a basic usage example copied here.As such, it would be very helpful if the Error Retry section of Error Handling and the Options section of API could be updated with this new usage.
The text was updated successfully, but these errors were encountered: