Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created April 18, 2021 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AllGistsEqual/df244ec283502d3c9620e5c2c4a8e555 to your computer and use it in GitHub Desktop.
Save AllGistsEqual/df244ec283502d3c9620e5c2c4a8e555 to your computer and use it in GitHub Desktop.
// File: src/screens/AppLoadingScreen.tsx
import React, { useEffect } from 'react'
import { Text, View, StyleSheet } from 'react-native'
import { MainNavigationProp } from '../routing/types'
import { MainRoutes } from '../routing/routes'
type AppLoadingScreenProps = {
navigation: MainNavigationProp<MainRoutes.Loading>
}
const AppLoadingScreen = ({ navigation }: AppLoadingScreenProps): React.ReactElement => {
useEffect(() => {
setTimeout(() => {
navigation.navigate(MainRoutes.Home)
}, 1500)
}, [navigation])
return (
<View style={styles.page}>
<Text>loading...</Text>
</View>
)
}
const styles = StyleSheet.create({
page: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
})
export default AppLoadingScreen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment