Lottie Files In react native Code (Part-1)
In this code here is only the code of lottie files to show because if it is not write the same as the code below it gives some rendering issue.
import React from 'react';
import LottieView from 'lottie-react-native';
export default class BasicExample extends React.Component {
componentDidMount() {
this.animation.play();
// Or set a specific startFrame and endFrame with:
this.animation.play(30, 120);
}
render() {
return (
<LottieView
ref={(animation) => {
this.animation = animation;
}}
source={require('./assets/4.json')}
/>
);
}
}
GitHub Dependencies Link to add dependencies
https://github.com/react-native-community/lottie-react-native
Comments
Post a Comment