Packages

swr

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

Your version

2.2.1

11 Aug 2023Where it was published

2.5.1 is the newest release of 2.x.

In short

1 new7 fixed1 changed5 internal

Release note

What's Changed

  • Add use client directive for client components exports

  • Remove the 'use client' directive and add client-only to useSWR entry.

  • Should serialize subscription fn key

  • Only make data and error update as a non-blocking transition

  • infinite: Fix the ability to use preload along with useSWRInfinite

  • Ensure that using preload with useSWRInfinite returns back an array of data

  • Preload request should be consumed within revalidate to support parallel option

  • Fix the issue that useSWR revalidation isn't triggered if the useSWR call happens after mutation

  • mutate: Fix types of mutate/trigger; make mutate/trigger always return the result of fetcher

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.