From 34897c1f9040e71edd7930fb8294ce0a2086117d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 13:59:18 +0000 Subject: [PATCH] chore(release): version packages --- .changeset/fix-usecallback-csrftoken-dep.md | 11 ----------- packages/nextjs/CHANGELOG.md | 12 ++++++++++++ packages/nextjs/package.json | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 .changeset/fix-usecallback-csrftoken-dep.md diff --git a/.changeset/fix-usecallback-csrftoken-dep.md b/.changeset/fix-usecallback-csrftoken-dep.md deleted file mode 100644 index 3e6a3f8..0000000 --- a/.changeset/fix-usecallback-csrftoken-dep.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@csrf-armor/nextjs": patch ---- - -fix(react): remove unnecessary `csrfToken` dependency from `useCallback` - -`secureFetch` previously listed `csrfToken` in its `useCallback` dependency array, causing the function reference to change every time the token updated. This made the `CsrfContextValue` unstable and triggered unnecessary re-renders in any component consuming `useCsrf()`. - -The token equality check (`newToken !== csrfToken`) was also redundant because React's `setState` already bails out for identical primitive values. Removing both the dependency and the comparison fixes the re-render issue without changing behavior. - -Fixes #53 diff --git a/packages/nextjs/CHANGELOG.md b/packages/nextjs/CHANGELOG.md index 80f9e18..cd8cadc 100644 --- a/packages/nextjs/CHANGELOG.md +++ b/packages/nextjs/CHANGELOG.md @@ -1,5 +1,17 @@ # @csrf-armor/nextjs +## 1.4.4 + +### Patch Changes + +- [#54](https://github.com/muneebs/csrf-armor/pull/54) [`e3da9dc`](https://github.com/muneebs/csrf-armor/commit/e3da9dcd9b24dff45365bf1a61ff0017c9ce2f57) Thanks [@muneebs](https://github.com/muneebs)! - fix(react): remove unnecessary `csrfToken` dependency from `useCallback` + + `secureFetch` previously listed `csrfToken` in its `useCallback` dependency array, causing the function reference to change every time the token updated. This made the `CsrfContextValue` unstable and triggered unnecessary re-renders in any component consuming `useCsrf()`. + + The token equality check (`newToken !== csrfToken`) was also redundant because React's `setState` already bails out for identical primitive values. Removing both the dependency and the comparison fixes the re-render issue without changing behavior. + + Fixes #53 + ## 1.4.3 ### Patch Changes diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 1f0e2e2..886d524 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@csrf-armor/nextjs", - "version": "1.4.3", + "version": "1.4.4", "description": "CSRF protection middleware for Next.js applications", "type": "module", "main": "./dist/index.js",