lottie-react-web
lottie-react-web copied to clipboard
segments not working?
I am having issues with the segments- for me, displaying a custom set of segments does not seem to do anything. My code:
import React from 'react';
import animation from './animation.json';
import Lottie from 'lottie-react-web';
const Opening = () => {
const options = {
loop: true,
autoplay: true,
prerender: true,
animationData: animation,
};
return (
<React.Fragment>
<Lottie options={options} segments={[0, 8]} />
</React.Fragment>
);
};
export default Opening;
I'm having the same issue.
Been looking into it and it might be implemented wrong in lottie-react-web
Seems like the segments logic needs to be hooked onto DOMLoaded
event of anim
I have not tested this, but it is mentioned in several issues from lottie-web
ex: https://github.com/airbnb/lottie-web/issues/581#issuecomment-408271807
I never got segments to work in any of the existing lottie-web
React wrappers, so I created a new, easier to use lottie React wrapper: react-lottie-player
Has this problem been solved