How to animate React Component with react-spring library depend on props updating
I found this https://codesandbox.io/s/xpqq0ll5nw and want to implement the same with hooks
const Counter = ({quantity}) => {
const animation = useSpring({
transform: 'scale(1)',
from: { transform: 'scale(1.2)' },
});
return (
<animated.span style={animation}">
{quantity}
</animated.span>
)
}