react-spring icon indicating copy to clipboard operation
react-spring copied to clipboard

[bug]: animated.div exception removes the zeros from the end of the number.

Open lomocc opened this issue 1 year ago • 0 comments

Which react-spring target are you using?

  • [X] @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?

animated.div will remove the .00 end of the number

To Reproduce

https://codesandbox.io/p/sandbox/ecstatic-https-t8kt3d?file=%2Fsrc%2FApp.tsx%3A14%2C9

first click the number, second click the update.

Expected Behaviour

<animated.div className={styles.content}>{props.width.to(x => x.toFixed(2))}</animated.div>

should always display the toFixed(2) number, just like 200.00

Link to repo

https://codesandbox.io/p/sandbox/ecstatic-https-t8kt3d?file=%2Fsrc%2FApp.tsx%3A14%2C9

lomocc avatar Mar 25 '24 09:03 lomocc