React native Lottie loader (Animation Loader)
GitHub Repo for Lottie-React-Native:- https://github.com/react-native-community/lottie-react-native
import React, {useEffect} from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
ActivityIndicator,
} from 'react-native';
import AnimatedLoader from 'react-native-animated-loader';
import LottieView from 'lottie-react-native';
import {createStackNavigator} from '@react-navigation/stack';
import {createDrawerNavigator} from '@react-navigation/drawer';
import Proflie from './screen/Proflie';
import {NavigationContainer} from '@react-navigation/native';
const AppStack = createStackNavigator();
const Drawer = createDrawerNavigator();
const AppStackScreen = ({Navigation}) => {
const [isLoading, setIsLoading] = React.useState(true);
useEffect(() => {
setTimeout(() => {
setIsLoading(false);
}, 3000);
}, []);
if (isLoading) {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<LottieView source={require('./assets/1.json')} autoPlay loop />
</View>
);
}
return (
<NavigationContainer>
<Drawer.Navigator>
<Drawer.Screen name="Proflie" component={Proflie} />
</Drawer.Navigator>
</NavigationContainer>
);
};
export default AppStackScreen;
Comments
Post a Comment