Which react-spring target are you using?
What version of react-spring are you using?
10.0.1
What's Wrong?
I'm using the imperative API to start a spring when a component is first mounted in my website. My component also re-renders at that time because a variable in a zustand store changes:
// This line is just here to cause a re-render of the component
const { causeReRender } = useReRenderStore();
useEffect(() => {
heightSpringAPI.start({ progress: 1.0 });
}, []);
The spring has always started properly until I switched from version 9.7.5 to version 10.0.1 of react-spring. Now it doesn't start at all.
To Reproduce
I have created a small repo that you can use to reproduce the bug: https://github.com/diegomacario/react-spring-bug
The repo simply animates a cube upwards when you open the website.
- The
main branch uses react-spring 9.7.5 and React 18. The spring starts properly with those versions.
- There is a branch called
react-spring-10.0.1-with-react-18. The spring doesn't start with those versions.
- There is a branch called
react-spring-10.0.1-with-react-19. The spring doesn't start with those versions.
Here are some deploys that allow you to compare:
Expected Behaviour
Springs should start regardless of whether re-renders happen or not, like they always did.
Link to repo
https://github.com/diegomacario/react-spring-bug
Which react-spring target are you using?
@react-spring/web@react-spring/three@react-spring/native@react-spring/konva@react-spring/zdogWhat version of react-spring are you using?
10.0.1
What's Wrong?
I'm using the imperative API to start a spring when a component is first mounted in my website. My component also re-renders at that time because a variable in a zustand store changes:
The spring has always started properly until I switched from version 9.7.5 to version 10.0.1 of react-spring. Now it doesn't start at all.
To Reproduce
I have created a small repo that you can use to reproduce the bug: https://github.com/diegomacario/react-spring-bug
The repo simply animates a cube upwards when you open the website.
mainbranch uses react-spring 9.7.5 and React 18. The spring starts properly with those versions.react-spring-10.0.1-with-react-18. The spring doesn't start with those versions.react-spring-10.0.1-with-react-19. The spring doesn't start with those versions.Here are some deploys that allow you to compare:
Expected Behaviour
Springs should start regardless of whether re-renders happen or not, like they always did.
Link to repo
https://github.com/diegomacario/react-spring-bug