diff --git a/.changeset/stable-useflow-actions.md b/.changeset/stable-useflow-actions.md deleted file mode 100644 index 140f6810c..000000000 --- a/.changeset/stable-useflow-actions.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@stackflow/react": patch ---- - -Memoize the action functions returned by `useFlow` and `useStepFlow` so their references stay stable across renders. - -Previously these hooks rebuilt their action object (`push`/`replace`/`pop`, `pushStep`/`replaceStep`/`popStep`) on every render, giving the returned functions a new reference each time. Since the underlying core actions are already a stable reference, the returned actions are now memoized on them (the same approach `usePrepare` already uses). This keeps the functions referentially stable when placed in `useEffect`/`useCallback` dependency arrays, avoiding unnecessary re-runs. diff --git a/docs/components/ChangelogContent.mdx b/docs/components/ChangelogContent.mdx index 8fd9f37bf..fd3b72acc 100644 --- a/docs/components/ChangelogContent.mdx +++ b/docs/components/ChangelogContent.mdx @@ -1,3 +1,14 @@ +## 2026.07.07 + +Memoize the action functions returned by `useFlow` and `useStepFlow` so their references stay stable across renders. [`91c433c`](https://github.com/daangn/stackflow/commit/91c433cc2f60462c59f6e1b990bc8339d7fbbc00) + +Previously these hooks rebuilt their action object (`push`/`replace`/`pop`, `pushStep`/`replaceStep`/`popStep`) on every render, giving the returned functions a new reference each time. Since the underlying core actions are already a stable reference, the returned actions are now memoized on them (the same approach `usePrepare` already uses). This keeps the functions referentially stable when placed in `useEffect`/`useCallback` dependency arrays, avoiding unnecessary re-runs. + +Released packages: +- 📦 [@stackflow/react@2.1.1](https://npmjs.com/package/@stackflow/react/v/2.1.1) + +--- + ## 2026.06.08 Expose `prepare` on the `stackflow()` output to preload an activity's component chunk and data loader from outside the React render tree (e.g. at app bootstrap, before the first render), without depending on React Context. [`510a287`](https://github.com/daangn/stackflow/commit/510a28705ef44dd153cef895cf88a341eb351ad3) diff --git a/integrations/react/CHANGELOG.md b/integrations/react/CHANGELOG.md index fbe7831ae..ffb978106 100644 --- a/integrations/react/CHANGELOG.md +++ b/integrations/react/CHANGELOG.md @@ -1,5 +1,13 @@ # @stackflow/react +## 2.1.1 + +### Patch Changes + +- 91c433c: Memoize the action functions returned by `useFlow` and `useStepFlow` so their references stay stable across renders. + + Previously these hooks rebuilt their action object (`push`/`replace`/`pop`, `pushStep`/`replaceStep`/`popStep`) on every render, giving the returned functions a new reference each time. Since the underlying core actions are already a stable reference, the returned actions are now memoized on them (the same approach `usePrepare` already uses). This keeps the functions referentially stable when placed in `useEffect`/`useCallback` dependency arrays, avoiding unnecessary re-runs. + ## 2.1.0 ### Minor Changes diff --git a/integrations/react/package.json b/integrations/react/package.json index d32a0b6c2..38394cfb2 100644 --- a/integrations/react/package.json +++ b/integrations/react/package.json @@ -1,6 +1,6 @@ { "name": "@stackflow/react", - "version": "2.1.0", + "version": "2.1.1", "repository": { "type": "git", "url": "https://github.com/daangn/stackflow.git",