-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
41 lines (34 loc) · 890 Bytes
/
Copy pathApp.tsx
File metadata and controls
41 lines (34 loc) · 890 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React, { useEffect, useState } from 'react';
import type { PropsWithChildren } from 'react';
import {
useColorScheme,
View,
} from 'react-native';
import Navigation from './src/navigation';
import { IsDarkContext } from './src/contexts/isDarkContext';
import SplashScreen from 'react-native-splash-screen';
type SectionProps = PropsWithChildren<{
title: string;
}>;
function App(): JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
// context value
const [isDark, setIsDark] = useState<boolean>(isDarkMode);
useEffect(() => {
SplashScreen.hide();
}, [])
return (
<IsDarkContext.Provider value={{ isDark, setIsDark }}>
<View style={{ flex: 1 }}>
<Navigation />
</View>
</IsDarkContext.Provider>
);
}
export default App;