Skip to content

[bug]: SpringValue.set doesn't schedule update to interpolation on first render #2374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 5 tasks
LoganDark opened this issue May 22, 2025 · 0 comments
Open
1 of 5 tasks
Labels
template: bug This issue might be a bug

Comments

@LoganDark
Copy link
Contributor

LoganDark commented May 22, 2025

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?

so in our app

Image

the top console log is from inside the to callback and the bottom console log is from the function that called entryValue.set in useResizeObserverAsSpringValue (see the codesandbox repro thing for gdfjhbgskj)

basically the call to entryValue.set seems to do nothing the first time it happens and doesn't properly schedule the interpolation to update

the next time the value is set and all other times works fine, just not the first time

To Reproduce

I guess call a springvalue.set inside a useEffect when the springvalue is part of an interpolation that already got passed to an animated.div, or something like that

repro has it and reproes consistently

Expected Behaviour

the call to springvalue.set should update the interpolation

Screen.Recording.mp4

watch this video maybe (has audio)

Link to repo

https://codesandbox.io/p/sandbox/stupefied-field-xv4m7q


I apologize for the sloppy bug report I am just super tired rn

@LoganDark LoganDark added the template: bug This issue might be a bug label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
template: bug This issue might be a bug
Projects
None yet
Development

No branches or pull requests

1 participant