Skip to content

[bug]: Spring props get reset on component update #2381

Open
@m10

Description

@m10

Which react-spring target are you using?

  • @react-spring/web
  • @react-spring/three
  • @react-spring/native
  • @react-spring/konva
  • @react-spring/zdog

What version of react-spring are you using?

10.0.1

What's Wrong?

react spring resets its props when state updates.

To Reproduce

have an updating state in the component that uses useSpring. The current spring value gets reset to initial on every component state update.

in the example codesandbox there is a blob which initially has 0.1 scale, on hover 1.5, when leaving mouse 1. so after initial hover it should have scale 1, but resets to 0.1 even during the hover. to tigger the bug a state updates happens every 100ms, this resets the props to the initial 0.1

Expected Behaviour

the springs should not reset to the initial value on state updates like on v 10.0.0

Link to repo

https://codesandbox.io/p/sandbox/wandering-lake-24pzkr

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions