Never miss a release that matters
AI-powered summaries of every GitHub release.
AI Summaries
Changelogs condensed into clear, actionable insights.
Always Free
Track up to 5 packages at no cost, forever.
Weekly Digest
A curated summary of every release, delivered weekly.
TL;DR
SWR now correctly prioritizes useSWRImmutable settings over the global refreshInterval, resolving unexpected data updates and unnecessary re-renders.
Fixes Worth Knowing
useSWRImmutable now functions as expected, overriding the global refresh interval. A fix prevents extra renders when switching to a new cache key. Preloading data now only happens on the client-side (web browser).
TL;DR
SWR now correctly handles data conditions within react.use, resolving a potential issue where fetches could restart unexpectedly.
Fixes Worth Knowing
Fixed an issue where react.use could incorrectly trigger re-fetches based on data conditions, improving stability and preventing unnecessary network requests.
TL;DR
SWR now supports functional optimisticData, allowing for more dynamic and responsive UI updates when mutations occur.
New
- Functional
optimisticDataallows you to provide a function to calculate optimistic UI state (temporary UI state) during mutations.
Fixes Worth Knowing
- Fixed an issue where
suspenseandrevalidateIfStaledidn’t work correctly together. - Resolved a type error in
SWRConfig.
TL;DR
SWR now requires a return type when using the mutate function, improving type safety for data updates.
Breaking
mutatefunction requires a return type (ensures correct data handling).
New
None.
Fixes Worth Knowing
None.
Before You Upgrade
Update your mutate calls to explicitly define a return type to avoid TypeScript errors.
TL;DR
SWR now correctly handles revalidation on focus, improving data freshness when switching between tabs or windows.
Fixes Worth Knowing
Fixed an issue where SWR would not revalidate data when a window regained focus, leading to stale data in some scenarios.
TL;DR
SWR now exposes its internal cache, allowing developers more control over data management (data storage and retrieval).
New
- Exposed Cache: Developers can now directly access and manipulate SWR’s cache for advanced use cases like pre-fetching or custom invalidation strategies.