I tried many times but it’s not showing
i want to show and resolve this problem,
here are my code
import { View, Text } from 'react-native'
import React from 'react'
import LottieView from 'lottie-react-native';
const App = () => {
return (
<View style={{ backgroundColor: 'white', height: '100%' }}>
<Text style={{ color: 'black' }}>Helo World</Text>
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center', width: '100%', backgroundColor: 'red'}}>
<LottieView
source={require('./PoliteChicky.json')}
style={{width: '100%'}}
autoPlay
loop
/>
</View>
</View>
)
}
export default App
2
Answers
He Goku Sama, i’ve something like this and works, please try to create a folder inside your src folder like image bellow and place the json from lottie inside. If this doesn’t works, can you share your project on github so we can take a better look on it.
This is a lottie animation:
Add this in your package.json file ,
Import this in your desired file
Use the LottieView as follows in your desired page