Last active
May 21, 2021 21:51
-
-
Save ajsmth/f8ed0b1074d260982708bd1ceb13311c to your computer and use it in GitHub Desktop.
Splash Screen Hanger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import * as SplashScreen from 'expo-splash-screen'; | |
import * as Font from 'expo-font'; | |
import Entypo from '@expo/vector-icons/Entypo'; | |
async function doSomeAsyncWork() { | |
throw new Error('123'); | |
} | |
async function prepare() { | |
await SplashScreen.preventAutoHideAsync(); | |
// setTimeout(() => { | |
// throw new Error('Hiyo'); | |
// }, 2000); | |
await doSomeAsyncWork(); | |
await SplashScreen.hideAsync(); | |
} | |
export default function App() { | |
useEffect(() => { | |
prepare(); | |
}, []); | |
return ( | |
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> | |
<Text>SplashScreen Demo! 👋</Text> | |
<Entypo name="rocket" size={30} /> | |
</View> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment