refreshIntervalYou can now pass a function as refreshInterval, to dynamically return the interval (in millisecond) til the next request, based on the current data:
useSWR('key', fetcher, {
refreshInterval: function (data: Data | undefined) {
if (!data) return 3000 // Initial request
return data.next_update
}
})
If return 0, polling will be stopped.
newData is deeply to the latest state, broadcast the latest state by @icyJoseph in https://github.com/vercel/swr/pull/1697undefined data if key's falsy under suspense mode by @icyJoseph in https://github.com/vercel/swr/pull/1698Full Changelog: https://github.com/vercel/swr/compare/1.1.0...1.1.1
Fetched April 18, 2026