Looping Lottie Animations Only Once


I was wondering how I can run a Lottie animation only once since it is looping by default.
Here is a link to the code I am trying to modify: https://docs.expo.io/versions/latest/sdk/lottie.html



Hey @airomo123,

I’m a bit confused. The animation does only play once in the Lottie example. :thinking:



I use

  startLottieAnim(anim) {
    this.lottieAnim = anim;
    if (anim) {

    ref={c => this.startLottieAnim(c)}              
      width: 400 - 100,
      height: 800 - 100
    source={require('../../../assets/superjump05_json.json')}  // eslint-disable-line

and the animation is also looping.

1 Like

Hey @gregt,

It looks like there is a loop prop on the Lottie API http://airbnb.io/lottie/react-native/props.html so just set that to false.



1 Like
closed #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.