[bug]: Incorrect result type in SpringValue onChange
handler
#2183
Labels
template: bug
This issue might be a bug
onChange
handler
#2183
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?
9.7.3
What's Wrong?
The
onChange
option in theSpringValue
constructor indicates that the argument is of typeAnimationResult<SpringValue<number>>
Thus,
result.value
is indicated to be of typenumber
, and logging this should display the animated value. However, it actually prints undefined as the spring animates:If I instead log the entire
result
, I see the number.To Reproduce
Expected Behaviour
I expect to see the value on
result.value
, which TypeScript indicates is anumber
Link to repo
https://codesandbox.io/s/vigorous-mirzakhani-qrrwj8?file=/src/App.tsx
The text was updated successfully, but these errors were encountered: