Animate react components as they appear on the viewport with react-spring
How to use the library
npm install @cjenaro/useanimateonshow react-springyarn add @cjenaro/useanimateonshow react-spring
The useAnimateOnShow function takes in from and to objects that are just as the react spring useSpring argument, you can configure duration and spring config here too.
Lastly, there is a third argument with some optional configuration
Infinite means that once the element leaves the screen it will animate out and then back in when it is shown again, there is also an optional onShow function that receives wether the element is showing or not.
MIT © jenaro94