Skip to content
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

onChange doesn't fire for spring controls #28

Open
mattrossman opened this issue Nov 20, 2020 · 1 comment
Open

onChange doesn't fire for spring controls #28

mattrossman opened this issue Nov 20, 2020 · 1 comment

Comments

@mattrossman
Copy link

To reproduce:

  • Open the example codesandbox and update to v0.4.2
  • Below line 41 add onChange: console.log

The value only gets logged on the initial renders, but changing the value does not cause new values to be printed. I would expect that as the value changes, the internal onChange handler from react-spring would fire.

Ultimately, the reason for #27 and now this issue is that I want to update a Three.js data structure in-place without triggering a bunch of re-renders for the component.

@mattrossman
Copy link
Author

There's something generally broken about the example. Changing the box position and subsequently changing the rotation causes the position to visually reset, even thought the position value hasn't changed in the panel.

When adding in the log statement from my previous comment, you'll also notice that when the component re-renders from a change in rotation it always logs the position as zero.

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

No branches or pull requests

1 participant