I am just trying to understand how the lottie-react return parameters can be accessed from a component. In the example component that they have setup, there is a list of returns https://gamote.github.io/lottie-react/hooks/useLottie#returns.
For example, how can I access Lottie.setDirection() to set it to -1 on click so the animation plays backwards? Or Lottie.pause() to pause the animation?
import { useLottie } from "lottie-react";
import groovyWalkAnimation from "./groovyWalk.json";
const style = {
height: 300,
};
const Example = () => {
const options = {
animationData: groovyWalkAnimation,
loop: true,
autoplay: true,
};
const { View } = useLottie(options, style);
return View;
};
export default Example;