---
name: SWR
slug: swr
type: github
source_url: https://github.com/vercel/swr
organization: Vercel
organization_slug: vercel
total_releases: 126
latest_version: v2.4.0
latest_date: 2026-02-01
last_updated: 2026-04-18
tracking_since: 2019-10-29
canonical: https://releases.sh/vercel/swr
organization_url: https://releases.sh/vercel
---

<Summary type="rolling" window-days="90" release-count="1">
SWR v2.4.0 focused on refinement and test infrastructure maturity. The team migrated suspense-related tests to end-to-end coverage, fixed several rendering inefficiencies in `useSWRImmutable` including unnecessary rerenders when switching keys and hydration-triggered updates, and ensured `preload` executes only in the browser environment rather than during server-side rendering.
</Summary>

<Release version="v2.4.0" date="February 1, 2026" published="2026-02-01T03:02:37.000Z" url="https://github.com/vercel/swr/releases/tag/v2.4.0">
## What's Changed
* chore: Migrate suspense related tests to e2e by @promer94 in https://github.com/vercel/swr/pull/4204
* CI: add missing flag for canary test by @promer94 in https://github.com/vercel/swr/pull/4206
* fix: Ensure useSWRImmutable overrides global refreshInterval by @CODEAbhinav-art in https://github.com/vercel/swr/pull/4208
* fix: Extra render when changing to new key with useSWRImmutable by @promer94 in https://github.com/vercel/swr/pull/4209
* fix: isHydration will cause unnecessary rerender  by @promer94 in https://github.com/vercel/swr/pull/4212
* fix: Ensure preload runs only on client by @Copilot in https://github.com/vercel/swr/pull/4213

## New Contributors
* @CODEAbhinav-art made their first contribution in https://github.com/vercel/swr/pull/4208
* @Copilot made their first contribution in https://github.com/vercel/swr/pull/4213

**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.8...v2.4.0
</Release>

<Release version="v2.3.8" date="December 15, 2025" published="2025-12-15T18:52:52.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.8">
## What's Changed
* deps: upgrade dev deps for build by @promer94 in https://github.com/vercel/swr/pull/4188
* update use-sync-external-store to latest by @huozhi in https://github.com/vercel/swr/pull/4189
* fix: cve-2025-55182 critical rce vulnerability by @PierreCrb in https://github.com/vercel/swr/pull/4192
* fix: cve-2025-55184 & CVE-2025-55183 by @PierreCrb in https://github.com/vercel/swr/pull/4198
* upgrade dev dep nextjs by @huozhi in https://github.com/vercel/swr/pull/4199
* update dev dependencies to address cve by @PierreCrb in https://github.com/vercel/swr/pull/4200
* enhance: Improve TSDoc comments by @shuding in https://github.com/vercel/swr/pull/4203
* test: Import `act` from React by @shuding in https://github.com/vercel/swr/pull/4202

## New Contributors
* @PierreCrb made their first contribution in https://github.com/vercel/swr/pull/4192

**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.7...v2.3.8
</Release>

<Release version="v2.3.7" date="November 28, 2025" published="2025-11-28T20:29:40.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.7">
## What's Changed
* deps: upgrade ci node version to 22 by @promer94 in https://github.com/vercel/swr/pull/4184
* deps: upgrade pnpm version by @promer94 in https://github.com/vercel/swr/pull/4185
* deps: upgrade playwright version by @promer94 in https://github.com/vercel/swr/pull/4186
* deps: upgrade eslint version and fix lint problem by @promer94 in https://github.com/vercel/swr/pull/4187
* feat: Add `strictServerPrefetchWarning` by @shuding in https://github.com/vercel/swr/pull/4183


**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.6...v2.3.7
</Release>

<Release version="v2.3.6" date="August 11, 2025" published="2025-08-11T15:54:37.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.6">
## Patches
* fix: do not error when not enabled during suspense by @huozhi in https://github.com/vercel/swr/pull/4156


**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.5...v2.3.6
</Release>

<Release version="v2.3.5" date="August 9, 2025" published="2025-08-09T08:57:49.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.5">
## Patches
* perf: optimize `useSWRConfig` with `useMemo` to maintain stable reference by @samuel871211 in https://github.com/vercel/swr/pull/4110
https://github.com/vercel/swr/pull/4076
* fix: react.use should not depend on data condition by @huozhi in https://github.com/vercel/swr/pull/4150

### Chores
* doc: Sync `PublicConfiguration.onDiscarded` tsdoc with SWR official website by @samuel871211 in 
* test: e2e test for 2702 by @promer94 in https://github.com/vercel/swr/pull/4154

## New Contributors
* @eungwang1 made their first contribution in https://github.com/vercel/swr/pull/2947

**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.4...v2.3.5
</Release>

<Release version="v2.3.5-beta.0" date="August 6, 2025" published="2025-08-06T14:45:31.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.5-beta.0">
## Patches
* perf: optimize `useSWRConfig` with `useMemo` to maintain stable reference by @samuel871211 in https://github.com/vercel/swr/pull/4110
* doc: Sync `PublicConfiguration.onDiscarded` tsdoc with SWR official website by @samuel871211 in https://github.com/vercel/swr/pull/4076
* feat: modify cache type to allow generic usage by @eungwang1 in https://github.com/vercel/swr/pull/2947
* Revert "feat: modify cache type to allow generic usage" by @huozhi in https://github.com/vercel/swr/pull/4151
* fix: react.use should not depend on data condition by @huozhi in https://github.com/vercel/swr/pull/4150

## New Contributors
* @eungwang1 made their first contribution in https://github.com/vercel/swr/pull/2947

**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.4...v2.3.5-beta.0
</Release>

<Release version="v2.3.4" date="July 2, 2025" published="2025-07-02T15:36:36.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.4">
## What's Changed
* Fix markdown typo by @Nusab19 in https://github.com/vercel/swr/pull/4106
* fix: check "if (!error)" skip error if value is cast to false by @vtgrachev in https://github.com/vercel/swr/pull/4118
* feat: Improve global suspense-enabled `data` type by @oosawy in https://github.com/vercel/swr/pull/4126
* fix: Performance improvement by reducing calls to toString() by @garyhuntddn in https://github.com/vercel/swr/pull/4092
* fix: Optimize the revalidation logic for same key requests. by @agadzik in https://github.com/vercel/swr/pull/4138

## New Contributors
* @Nusab19 made their first contribution in https://github.com/vercel/swr/pull/4106
* @vtgrachev made their first contribution in https://github.com/vercel/swr/pull/4118
* @garyhuntddn made their first contribution in https://github.com/vercel/swr/pull/4092

**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.3...v2.3.4
</Release>

<Release version="v2.3.3" date="March 6, 2025" published="2025-03-06T20:15:47.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.3">
### Patches
* enhance: use empty prototype object by @huozhi in https://github.com/vercel/swr/pull/4099
* Initialise nextFocusRevalidatedAt on mount by @mgoodfellow in https://github.com/vercel/swr/pull/2857

### Misc
* Update Twitter references to X by @ManuLpz4 in https://github.com/vercel/swr/pull/4103

## New Contributors
* @ManuLpz4 made their first contribution in https://github.com/vercel/swr/pull/4103
* @mgoodfellow made their first contribution in https://github.com/vercel/swr/pull/2857

**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.2...v2.3.3
</Release>

<Release version="v2.3.2" date="February 5, 2025" published="2025-02-05T17:03:39.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.2">
## Patches
* (fix) keepPreviousData: return fallback instead of undefined value by @dvoytenko in https://github.com/vercel/swr/pull/4087


**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.1...v2.3.2
</Release>

<Release version="v2.3.1" date="February 5, 2025" published="2025-02-05T01:06:47.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.1">
### Fixes
* fix: missing `throwOnError` in SWRMutationHook options by @Ram4GB in https://github.com/vercel/swr/pull/3054
* fix: sever env detection for deno by @elrrrrrrr in https://github.com/vercel/swr/pull/4064
* keepPreviousData: return fallback instead of undefined value by @dvoytenko in https://github.com/vercel/swr/pull/4084

### Misc
* ci: update pnpm setup and lock pnpm vesion by @huozhi in https://github.com/vercel/swr/pull/4085
* build: bump bundler by @huozhi in https://github.com/vercel/swr/pull/4086
* refactor: type improvement of `useSWRHandler` by @samuel871211 in https://github.com/vercel/swr/pull/4075

## New Contributors
* @Ram4GB made their first contribution in https://github.com/vercel/swr/pull/3054
* @elrrrrrrr made their first contribution in https://github.com/vercel/swr/pull/4064
* @dvoytenko made their first contribution in https://github.com/vercel/swr/pull/4084
* @samuel871211 made their first contribution in https://github.com/vercel/swr/pull/4075

**Full Changelog**: https://github.com/vercel/swr/compare/v2.3.0...v2.3.1
</Release>

<Release version="v2.3.0" date="December 23, 2024" published="2024-12-23T15:27:46.000Z" url="https://github.com/vercel/swr/releases/tag/v2.3.0">
### Feature

* Support promises as fallback data by @shuding in https://github.com/vercel/swr/pull/2891
* Allow to use with React 19 by @vladshcherbin and @devjiwonchoi in https://github.com/vercel/swr/pull/3047, https://github.com/vercel/swr/pull/2963

### Patches

* fix #3030 and run relateive test in edge-runtime by @promer94 in https://github.com/vercel/swr/pull/3036
* fix: Only suspend when using the `fallback` by @shuding in https://github.com/vercel/swr/pull/3045
* fix type check in tests by @huozhi in https://github.com/vercel/swr/pull/3052
* fix: Replace the deprecated 'window' with 'globalThis' for Deno by @saul-atomrigs in https://github.com/vercel/swr/pull/2915
* fix: check if config.fallback is undefined by @taku-hatano in https://github.com/vercel/swr/pull/2913
* fix(infinte): export SWRInfiniteKeyedMutator type by @LeoMcA in https://github.com/vercel/swr/pull/2900
* fix: Improve comparison performance by @shuding in https://github.com/vercel/swr/pull/2973
* Export ScopedMutator type by @joshkel in https://github.com/vercel/swr/pull/2937
* Improve-Type-Safety-and-State-Access-in-useStateWithDeps-Hook by @O-BERNARDOFOEGBU in https://github.com/vercel/swr/pull/3027

### Misc

* chore: bump dev deps and change example react version to latest by @huozhi in https://github.com/vercel/swr/pull/2894
* build: fix beta release job by @huozhi in https://github.com/vercel/swr/pull/2895
* chore: Improve test coverage by @shuding in https://github.com/vercel/swr/pull/2903
* chore: simplify test coverage strategy by @huozhi in https://github.com/vercel/swr/pull/2909
* build: simplify react-server export and update bundler by @huozhi in https://github.com/vercel/swr/pull/2897
* examples: add RSC streaming pre-render with promise fallback example by @promer94 in https://github.com/vercel/swr/pull/2905
* Drop client-only by @huozhi in https://github.com/vercel/swr/pull/2910
* Mark package as side-effect free by @htunnicliff in https://github.com/vercel/swr/pull/2904
* Drop exports module field by @huozhi in https://github.com/vercel/swr/pull/2911
* chore: update pkg script watch by @unliar in https://github.com/vercel/swr/pull/2920
* test: remove console.error times check by @promer94 in https://github.com/vercel/swr/pull/2918
* build: bump bundler for perf by @huozhi in https://github.com/vercel/swr/pull/2929
* Fix bundling of client entry chunks  by @huozhi in https://github.com/vercel/swr/pull/2932
* ci: fix ci error and upgrade action version by @promer94 in https://github.com/vercel/swr/pull/2952
* Add SWRInfiniteMutatorOptions type to export by @ludwigbacklund in https://github.com/vercel/swr/pull/2954
* test: update the revalidate function test for useSWRInfinite by @koba04 in https://github.com/vercel/swr/pull/2955
* chore: upgrade nextjs dev dep for e2e testing by @huozhi in https://github.com/vercel/swr/pull/3044
* ci: simplify ci config and bump some deps version by @promer94 in https://github.com/vercel/swr/pull/2770
* chore: reorganize entries by @huozhi in https://github.com/vercel/swr/pull/3048
* Bump bundler and reorganize serialize exports by @huozhi in https://github.com/vercel/swr/pull/3049
* upgrade use-sync-external-store to support react 19 by @huozhi in https://github.com/vercel/swr/pull/3050


## New Contributors
* @htunnicliff made their first contribution in https://github.com/vercel/swr/pull/2904
* @saul-atomrigs made their first contribution in https://github.com/vercel/swr/pull/2915
* @unliar made their first contribution in https://github.com/vercel/swr/pull/2920
* @ludwigbacklund made their first contribution in https://github.com/vercel/swr/pull/2954
* @taku-hatano made their first contribution in https://github.com/vercel/swr/pull/2913
* @LeoMcA made their first contribution in https://github.com/vercel/swr/pull/2900
* @devjiwonchoi made their first contribution in https://github.com/vercel/swr/pull/2963
* @vladshcherbin made their first contribution in https://github.com/vercel/swr/pull/3047
* @O-BERNARDOFOEGBU made their first contribution in https://github.com/vercel/swr/pull/3027

**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.5...v2.3.0
</Release>

<Release version="v2.2.6-beta.4" date="June 1, 2024" published="2024-06-01T00:01:58.000Z" url="https://github.com/vercel/swr/releases/tag/v2.2.6-beta.4">
## What's Changed
* fix: Improve comparison performance by @shuding in https://github.com/vercel/swr/pull/2973


**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.6-beta.3...v2.2.6-beta.4
</Release>

<Release version="v2.2.6-beta.3" date="May 24, 2024" published="2024-05-24T22:15:51.000Z" url="https://github.com/vercel/swr/releases/tag/v2.2.6-beta.3">
## What's Changed
* ci: fix ci error and upgrade action version by @promer94 in https://github.com/vercel/swr/pull/2952
* Add SWRInfiniteMutatorOptions type to export by @ludwigbacklund in https://github.com/vercel/swr/pull/2954
* test: update the revalidate function test for useSWRInfinite by @koba04 in https://github.com/vercel/swr/pull/2955
* Export ScopedMutator type by @joshkel in https://github.com/vercel/swr/pull/2937
* fix: check if config.fallback is undefined by @taku-hatano in https://github.com/vercel/swr/pull/2913
* fix(infinte): export SWRInfiniteKeyedMutator type by @LeoMcA in https://github.com/vercel/swr/pull/2900
* chore: add react peerDeps 19 by @devjiwonchoi in https://github.com/vercel/swr/pull/2963

## New Contributors
* @ludwigbacklund made their first contribution in https://github.com/vercel/swr/pull/2954
* @taku-hatano made their first contribution in https://github.com/vercel/swr/pull/2913
* @LeoMcA made their first contribution in https://github.com/vercel/swr/pull/2900
* @devjiwonchoi made their first contribution in https://github.com/vercel/swr/pull/2963

**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.6-beta.2...v2.2.6-beta.3
</Release>

<Release version="v2.2.6-beta.2" date="April 6, 2024" published="2024-04-06T16:22:12.000Z" url="https://github.com/vercel/swr/releases/tag/v2.2.6-beta.2">
## Patches
* build: bump bundler for perf by @huozhi in https://github.com/vercel/swr/pull/2929
* Fix bundling of client entry chunks  by @huozhi in https://github.com/vercel/swr/pull/2932


**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.6-beta.1...v2.2.6-beta.2
</Release>

<Release version="v2.2.6-beta.1" date="March 31, 2024" published="2024-03-31T11:07:53.000Z" url="https://github.com/vercel/swr/releases/tag/v2.2.6-beta.1">
## What's Changed
* build: fix beta release job by @huozhi in https://github.com/vercel/swr/pull/2895
* chore: Improve test coverage by @shuding in https://github.com/vercel/swr/pull/2903
* chore: simplify test coverage strategy by @huozhi in https://github.com/vercel/swr/pull/2909
* build: simplify react-server export and update bundler by @huozhi in https://github.com/vercel/swr/pull/2897
* examples: add RSC streaming pre-render with promise fallback example by @promer94 in https://github.com/vercel/swr/pull/2905
* Drop client-only by @huozhi in https://github.com/vercel/swr/pull/2910
* Mark package as side-effect free by @htunnicliff in https://github.com/vercel/swr/pull/2904
* Drop exports module field by @huozhi in https://github.com/vercel/swr/pull/2911
* fix: Replace the deprecated 'window' with 'globalThis' for Deno by @saul-atomrigs in https://github.com/vercel/swr/pull/2915
* chore: update pkg script watch by @unliar in https://github.com/vercel/swr/pull/2920
* test: remove console.error times check by @promer94 in https://github.com/vercel/swr/pull/2918

## New Contributors
* @htunnicliff made their first contribution in https://github.com/vercel/swr/pull/2904
* @saul-atomrigs made their first contribution in https://github.com/vercel/swr/pull/2915
* @unliar made their first contribution in https://github.com/vercel/swr/pull/2920

**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.6-beta.0...v2.2.6-beta.1
</Release>

<Release version="v2.2.5" date="February 15, 2024" published="2024-02-15T23:32:26.000Z" url="https://github.com/vercel/swr/releases/tag/v2.2.5">
## Patches
* types: isLoading typed as boolean when using fallbackData (#2866) by @yjrhgvbn in https://github.com/vercel/swr/pull/2875
* fix: allow onErrorRetry on inactive tab without focus/reconnect revalidation by @qkdreyer in https://github.com/vercel/swr/pull/2848
* feat: pass a function to the revalidate option in mutate by @koba04 in https://github.com/vercel/swr/pull/2862
* fix: SWRConfiguration type by @hulla-dev in https://github.com/vercel/swr/pull/2882

## Misc
* build: use new bundle convention by @huozhi in https://github.com/vercel/swr/pull/2865
* chore: update pnpm-lock.yaml by @koba04 in https://github.com/vercel/swr/pull/2874
* chore: remove useless comment by @kongmoumou in https://github.com/vercel/swr/pull/2868
* test: run pnpm test on CI by @koba04 in https://github.com/vercel/swr/pull/2872
* fix: all act warnings by @koba04 in https://github.com/vercel/swr/pull/2861
* Update bundler by @huozhi in https://github.com/vercel/swr/pull/2830

## New Contributors
* @kongmoumou made their first contribution in https://github.com/vercel/swr/pull/2868
* @yjrhgvbn made their first contribution in https://github.com/vercel/swr/pull/2875
* @qkdreyer made their first contribution in https://github.com/vercel/swr/pull/2848
* @hulla-dev made their first contribution in https://github.com/vercel/swr/pull/2882

**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.4...v2.2.5
</Release>

<Release version="v2.2.4" date="September 25, 2023" published="2023-09-25T12:36:37.000Z" url="https://github.com/vercel/swr/releases/tag/v2.2.4">
## Patches
* Revert "Remove `index.js` suffix of `use-sync-external-store/shim` to support React Native" by @huozhi in https://github.com/vercel/swr/pull/2802


**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.3...v2.2.4
</Release>

<Release version="v2.2.3" date="September 25, 2023" published="2023-09-25T09:39:31.000Z" url="https://github.com/vercel/swr/releases/tag/v2.2.3">
## Patches
* fix: remove permissive type by @wcatron in https://github.com/vercel/swr/pull/2759
* Remove `index.js` suffix of `use-sync-external-store/shim` to support React Native by @malash in https://github.com/vercel/swr/pull/2767
* fix: default to fetch type in keyed mutator by @linkvt in https://github.com/vercel/swr/pull/2753
* types: export mutation types by @promer94 in https://github.com/vercel/swr/pull/2780

## Misc

* test: update tests, use matched types for mutate api by @huozhi in https://github.com/vercel/swr/pull/2781

## New Contributors
* @wcatron made their first contribution in https://github.com/vercel/swr/pull/2759
* @malash made their first contribution in https://github.com/vercel/swr/pull/2767
* @linkvt made their first contribution in https://github.com/vercel/swr/pull/2753

**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.2...v2.2.3
</Release>

<Release version="v2.2.2" date="August 27, 2023" published="2023-08-27T12:34:05.000Z" url="https://github.com/vercel/swr/releases/tag/v2.2.2">
## What's Changed
* fix: It should use startTransition only when IS_REACT_LEGACY is false by @TopGrd in https://github.com/vercel/swr/pull/2756
* fix: simplify `ArgumentsTuple` by @Andarist in https://github.com/vercel/swr/pull/2761

## New Contributors
* @TopGrd made their first contribution in https://github.com/vercel/swr/pull/2756
* @Andarist made their first contribution in https://github.com/vercel/swr/pull/2761

**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.1...v2.2.2
</Release>

<Release version="v2.2.1" date="August 27, 2023" published="2023-08-27T12:33:40.000Z" url="https://github.com/vercel/swr/releases/tag/v2.2.1">
## What's Changed
* Add use client directive for client components exports by @huozhi in https://github.com/vercel/swr/pull/2696
* remove the 'use client' directive and add client-only to useSWR entry. by @promer94 in https://github.com/vercel/swr/pull/2705
* fix: should serialize subscription fn key by @promer94 in https://github.com/vercel/swr/pull/2711
* build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 by @dependabot in https://github.com/vercel/swr/pull/2720
* fix: only make data and error update as a non-blocking transition by @promer94 in https://github.com/vercel/swr/pull/2691
* build: generate d.mts for for .mjs, so typescript could resolve types correctly by @promer94 in https://github.com/vercel/swr/pull/2695
* fix(infinite): Fix the ability to use preload along with useSWRInfinite by @agadzik in https://github.com/vercel/swr/pull/2723
* fix: Ensure that using preload with useSWRInfinite returns back an array of data by @agadzik in https://github.com/vercel/swr/pull/2726
* fix: preload request should be consumed within `revalidate` to support `parallel` option by @promer94 in https://github.com/vercel/swr/pull/2727
* Fix the issue that useSWR revalidation isn't triggered if the useSWR call happens after mutation by @Ponyets in https://github.com/vercel/swr/pull/2731
* fix(mutate): fix types of mutate/trigger; make mutate/trigger always return the result of fetcher by @Ponyets in https://github.com/vercel/swr/pull/2708
* build(deps-dev): bump tough-cookie from 4.1.2 to 4.1.3 by @dependabot in https://github.com/vercel/swr/pull/2735
* build(deps-dev): bump json5 from 2.2.1 to 2.2.3 by @dependabot in https://github.com/vercel/swr/pull/2736
* docs: use isLoading instead of !data by @pawfa in https://github.com/vercel/swr/pull/2734

## New Contributors
* @agadzik made their first contribution in https://github.com/vercel/swr/pull/2723
* @Ponyets made their first contribution in https://github.com/vercel/swr/pull/2731
* @pawfa made their first contribution in https://github.com/vercel/swr/pull/2734

**Full Changelog**: https://github.com/vercel/swr/compare/v2.2.0...v2.2.1
</Release>

<Pagination page="1" total-pages="7" total-items="126" next="https://releases.sh/vercel/swr.md?page=2" />
