Skip to content

Commit 4c9ce54

Browse files
yjoseasdolo
authored andcommitted
feat: update to the new splash screen plugin config
1 parent fc2faf7 commit 4c9ce54

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

app.config.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
3232
icon: './assets/icon.png',
3333
userInterfaceStyle: 'automatic',
3434
newArchEnabled: true,
35-
splash: {
36-
image: './assets/splash.png',
37-
resizeMode: 'cover',
38-
backgroundColor: '#2E3C4B',
39-
},
4035
updates: {
4136
fallbackToCacheTimeout: 0,
4237
url: `https://u.expo.dev/${Env.EAS_PROJECT_ID}`,
@@ -67,6 +62,14 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
6762
bundler: 'metro',
6863
},
6964
plugins: [
65+
[
66+
'expo-splash-screen',
67+
{
68+
backgroundColor: '#000000',
69+
image: './assets/splash-icon.png',
70+
imageWidth: 200,
71+
},
72+
],
7073
[
7174
'expo-font',
7275
{

assets/splash-icon.png

10.8 KB
Loading

assets/splash.png

-20.7 KB
Binary file not shown.

src/app/_layout.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import '../../global.css';
33

44
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
55
import { ThemeProvider } from '@react-navigation/native';
6-
import { SplashScreen, Stack } from 'expo-router';
6+
import { Stack } from 'expo-router';
7+
import * as SplashScreen from 'expo-splash-screen';
78
import React from 'react';
89
import { useTranslation } from 'react-i18next';
910
import { StyleSheet } from 'react-native';
@@ -28,6 +29,11 @@ loadSelectedTheme();
2829
interceptors();
2930
// Prevent the splash screen from auto-hiding before asset loading is complete.
3031
SplashScreen.preventAutoHideAsync();
32+
// Set the animation options. This is optional.
33+
SplashScreen.setOptions({
34+
duration: 1000,
35+
fade: true,
36+
});
3137

3238
export default function RootLayout() {
3339
const { t } = useTranslation();

0 commit comments

Comments
 (0)