-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy path_layout.tsx
More file actions
42 lines (36 loc) · 979 Bytes
/
_layout.tsx
File metadata and controls
42 lines (36 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import '../global.css';
import { useFonts } from 'expo-font';
import { Stack } from 'expo-router';
import { StatusBar } from 'expo-status-bar';
import React, { useEffect } from 'react';
import { Alert, Linking } from 'react-native';
import 'react-native-reanimated';
export default function RootLayout() {
const [loaded] = useFonts({
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
});
useEffect(() => {
// Handle deep links
const urlListener = Linking.addEventListener('url', (event) => {
if (event) {
Alert.alert('Deep Link', event.url);
}
});
return () => {
urlListener.remove();
};
}, []);
if (!loaded) {
// Async font loading only occurs in development.
return null;
}
return (
<>
<Stack>
<Stack.Screen name="(tabs)/index" options={{ headerShown: false }} />
<Stack.Screen name="+not-found" />
</Stack>
<StatusBar style="auto" />
</>
);
}