removed splashscreen dependency (deprecated)

This commit is contained in:
Martin Bauer 2023-10-28 14:06:08 +02:00
parent 3c62e1e04b
commit 977d4bcbc9
1 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import AppLoading from 'expo-app-loading'; import * as SplashScreen from 'expo-splash-screen';
import { Ionicons } from '@expo/vector-icons'; import { Ionicons } from '@expo/vector-icons';
import * as Font from 'expo-font'; import * as Font from 'expo-font';
@ -37,6 +37,9 @@ const store = createStore(persistedReducer);
const persistor = persistStore(store); const persistor = persistStore(store);
const Stack = createStackNavigator(); const Stack = createStackNavigator();
// Keep the splash screen visible while we fetch resources
SplashScreen.preventAutoHideAsync();
export default class App extends React.Component { export default class App extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -70,9 +73,10 @@ export default class App extends React.Component {
} }
render() { render() {
if (!this.state.isReady) { if(this.state.isReady) {
return <AppLoading />; SplashScreen.hideAsync();
} }
const screenOptions = { const screenOptions = {
headerShown: false, headerShown: false,
}; };
@ -137,8 +141,8 @@ export default class App extends React.Component {
return ( return (
<Provider store={store}> <Provider store={store}>
<PersistGate loading={<AppLoading />} persistor={persistor}> <PersistGate persistor={persistor}>
<NavigationContainer> <NavigationContainer >
<Stack.Navigator > <Stack.Navigator >
{activeView} {activeView}
</Stack.Navigator> </Stack.Navigator>