Skip to content

fix(core): animate useResize updates from zero dimensions - #2618

Open
minwookshin wants to merge 1 commit into
pmndrs:nextfrom
minwookshin:fix/2234
Open

minwookshin wants to merge 1 commit into
pmndrs:nextfrom
minwookshin:fix/2234

Conversation

@minwookshin

Copy link
Copy Markdown

Why

useResize treats every zero width or height as an initial measurement, so expanding a collapsed container jumps to its new size. Fixes #2234.

What

Track the first resize observation separately and keep later zero-size updates animated. Explicit immediate: true still takes effect.

Added five regression tests and a browser test that expands and collapses a real ResizeObserver container twice. Validation: 406 unit tests, 50 type tests, 13 browser tests, package builds, type checking, lint, and formatting.

Checklist

  • Changeset added
  • Regression coverage added
  • Ready to be merged

@changeset-bot

changeset-bot Bot commented Oct 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0a208e5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@react-spring/core Patch
@react-spring/animated Patch
@react-spring/parallax Patch
@react-spring/rafz Patch
@react-spring/shared Patch
@react-spring/types Patch
@react-spring/three Patch
@react-spring/web Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: useResize is jumpy

1 participant