Packages

swr

2.5.1 · 12 Aug 2026MIT28.9M / weekRepositoryHomepagenpmAtom feed

Your version

2.5.0

3 Aug 2026Where it was published

2.5.1 is the newest release of 2.x.

In short

1 fixed

Release note

Features

RSC cache preloading

Preload data in React Server Components and pass it to client hooks through SWRConfig. This avoids a duplicate initial browser request and hydrates the result into the SWR cache. The new cacheData option is experimental.

#4275

New unload() API

Use unload() to clear the entire SWR cache and discard in-flight requests and mutations. Mounted hooks revalidate by default, or you can pass { revalidate: false } to keep the cache empty until the next revalidation.

#4298

Fixes

  • Fixed the swr/_internal React Server export so it resolves correctly in the published package

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.