Skip to content

v.2.5.0

Latest

Choose a tag to compare

@huozhi huozhi released this 03 Aug 14:54
8b9bb97

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 by @pengshenghai in #4272

New Contributors

Full Changelog: v2.4.2...v2.5.0