swr
2.5.1 · 12 Aug 2026MIT28.9M / weekRepositoryHomepagenpmAtom feed
2.5.1 is the newest release of 2.x.
In short
1 new2 fixed8 changed1 internal
Release note
In this patch release, we majorly improved typing support and SWR can infer the types based on the configuration.
When the
suspenseoption istrue, the returneddatawill excludeundefinedand theisLoadingwill always befalse.When the
fallbackDataoption is provided, the returneddatawill be the same type offallbackData, and theisLoadingwill always befalse.
Here's a demo for it:
user-images.githubusercontent.com/4800338/21328…
What's Changed
types: Make FullConfiguration generic
type: Enforce array literal as tuple
Improve type test
Update bunchee to remove the extra target cli option
useSWRMutation should always use the latest fetcher
types: Conditional swr response
Types properites in exports fields
Update license year
Add all mutate options support to useSWRInfinite
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.