mifi / react-lottie-player

Fully declarative React Lottie player
MIT License
495 stars 52 forks source link

Play on hover #75

Closed anubra266 closed 2 years ago

anubra266 commented 2 years ago

I can't find a prop to play my animation on hover.

mifi commented 2 years ago

react-lotie-player doesnt implement that feature. you need to implement yourself

anubra266 commented 2 years ago

react-lotie-player doesnt implement that feature. you need to implement yourself

Thanks @mifi could you point me to some guide on how to do that.

mifi commented 2 years ago

I think something like this:

const [playing, setPlaying] = useState(false);

return <Lottie onMouseOver={() => setPlaying(true)} play={playing} />