releases.shpreview
Vercel/SWR/1.1.2

1.1.2

December 26, 2021SWRView original ↗
$npx -y @buildinternet/releases show rel_OVnIpo7gMegt2TbXwEBOr

Highlights of This Release

Use the Latest Fetcher Function

SWR will now use the latest fetcher function passed to the hook, when sending the request. Previously it uses the initial snapshotted fetcher.

Avoid Unnecessary Auto Revalidations

When refocusing on the window with state changes (like clicking a button that changes the SWR key immediately), SWR now avoids revalidations if they're not necessary. Details can be found in #1720.

New Types for useSWRInfinite

Two types for useSWRInfinite are added: SWRInfinteHook and SWRInfinteKeyLoader. You can use them to type the hook and the getKey function.

New populateCache option for mutate

A new option to control if the mutation data should be written to the cache. You can find the details in #1729.

What's Changed

New Contributors

Full Changelog: https://github.com/vercel/swr/compare/1.1.1...1.1.2

Fetched April 18, 2026