# What changed in swr

> 8 changes in swr 2 from its official release notes, upgrade guides and advisories: 2 new APIs and options. Each one cited. Sources checked 2026-10-22. HTML: https://unstale.sh/npm/swr/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## swr 2

### New APIs and options

- The experimental cacheData option enables preloading data in React Server Components and passing it to client hooks through SWRConfig, avoiding a duplicate initial browser request and hydrating the result into the SWR cache. (2.5.0) — [release notes](https://github.com/vercel/swr/releases/tag/v2.5.0)
- The new unload() API clears the entire SWR cache and discards in-flight requests and mutations. Mounted hooks revalidate by default, or pass { revalidate: false } to keep the cache empty until the next revalidation. (2.5.0) — [release notes](https://github.com/vercel/swr/releases/tag/v2.5.0)

### Fixes and other changes

- Hooks without a fetcher now hydrate cacheData correctly. (2.5.1) — [release notes](https://github.com/vercel/swr/releases/tag/v2.5.1)
- Suspense cacheData is revalidated when a component remounts. (2.5.1) — [release notes](https://github.com/vercel/swr/releases/tag/v2.5.1)
- Completed subscription state is cleaned up. (2.5.1) — [release notes](https://github.com/vercel/swr/releases/tag/v2.5.1)
- Fixed the React Server export so it resolves correctly in the published package. (2.5.0) — [release notes](https://github.com/vercel/swr/releases/tag/v2.5.0)
- Double-unsubscribing no longer removes the wrong subscriber from the cache. (2.4.2) — [release notes](https://github.com/vercel/swr/releases/tag/v2.4.2)
- A resolved promise no longer suspends because of missing status. (2.4.2) — [release notes](https://github.com/vercel/swr/releases/tag/v2.4.2)
