Open Hamdysaad20 opened 2 years ago
I think you can try to get the lottieRef ref object from the component and call the setSpeed from there.
I have the same question. How can I set the default speed of it instead of using the "setSpeed" function ? The function makes the config become complicated.
@DaphneChang Currently (for what I've seen in the source code), is not possible to pass the speed value as a prop to the Lottie component... What do u mean with "makes the config become complicated"?
I'm using the onDOMLoaded
attribute to essentially do what you're asking (except in my example I was trying to set the direction to reverse):
const lottieRef = useRef(null)
return <Lottie animationData={someLottie} autoplay loop lottieRef={lottieRef}
onDOMLoaded={() => lottieRef.current?.setDirection(-1)}
/>
Hi everyone, this package had an update 4 months ago. I want to know if this issue is fixed or not.
@Keyvan-RezaeiF it was a dependency update, not a feature update.
Edit: it also fixes #77
hi , thank you for the amazing library . can you help me with this issue , i can't find a way to set the speed for this library