TuckerMassad / react-animated-counter

React Animated Counter Component
MIT License
66 stars 12 forks source link

Theres a translate-y animation triggered when a scrollTo animation is triggered. #13

Open masrur-mmrs opened 6 months ago

masrur-mmrs commented 6 months ago

When the scrollTo event is triggered in AnimatedCounter.tsx, an unwanted translate-y animation occurs from the bottom. This issue appears to be related to the incorrect setting of the position value, which leads to unnecessary re-renders or state changes. I also think, improper application of containerStyles to the container might be causing layout shifts or animations during scroll.

https://github.com/TuckerMassad/react-animated-counter/assets/42804706/48088fa2-cccb-4ef8-9b55-9c8e7d79a20b

TuckerMassad commented 6 months ago

Hi @masrur-mmrs , can you give me some example code so I can reproduce this issue locally?

masrur-mmrs commented 6 months ago

So the animated counter here is nested in a bunch of components here's the code for it: `

{/* {totalItems} */} `