React native lottie animation 2020

To use Lottie Animation in your Project Follow below code or example:  

1. Run or Install: npm i lottie-react-native

2. Import 
    import {View,StyleSheet } from 'react-native';

3. Full Example

import React, { Component } from 'react';
import {View,StyleSheet } from 'react-native';


import LottieView from 'lottie-react-native';

class App extends Component
{
  
  render()
  {
    return(
      <View style={styles.container}>
        <LottieView source={require('../LottieAnimation/animations/stackoverflow-icon.json')} autoPlay loop />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex:1,
    flexDirection:"column"
  },
});

export default App;


lottie animation in react native

You may like these posts