MCPcopy Create free account
hub / github.com/expo/examples / App

Function App

with-react-navigation/src/App.tsx:13–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11SplashScreen.preventAutoHideAsync();
12
13export function App() {
14 const colorScheme = useColorScheme();
15 const [loaded] = useFonts({
16 SpaceMono: require('./assets/fonts/SpaceMono-Regular.ttf'),
17 });
18
19 if (!loaded) {
20 // Async font loading only occurs in development.
21 return null;
22 }
23
24 const theme =
25 colorScheme === 'dark'
26 ? {
27 ...DarkTheme,
28 colors: { ...DarkTheme.colors, primary: Colors[colorScheme ?? 'light'].tint },
29 }
30 : {
31 ...DefaultTheme,
32 colors: { ...DefaultTheme.colors, primary: Colors[colorScheme ?? 'light'].tint },
33 };
34
35 return (
36 <Navigation
37 theme={theme}
38 linking={{
39 enabled: 'auto',
40 prefixes: [
41 // Change the scheme to match your app's scheme defined in app.json
42 'helloworld://',
43 ],
44 }}
45 onReady={() => {
46 SplashScreen.hideAsync();
47 }}
48 />
49 );
50}

Callers

nothing calls this directly

Calls 1

useColorSchemeFunction · 0.85

Tested by

no test coverage detected