MCPcopy Create free account
hub / github.com/code100x/mobile-magic / useColorScheme

Function useColorScheme

expo-base-app/hooks/useColorScheme.web.ts:7–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5 * To support static rendering, this value needs to be re-calculated on the client side for web
6 */
7export function useColorScheme() {
8 const [hasHydrated, setHasHydrated] = useState(false);
9
10 useEffect(() => {
11 setHasHydrated(true);
12 }, []);
13
14 const colorScheme = useRNColorScheme();
15
16 if (hasHydrated) {
17 return colorScheme;
18 }
19
20 return 'light';
21}

Callers 5

CollapsibleFunction · 0.90
ParallaxScrollViewFunction · 0.90
RootLayoutFunction · 0.90
TabLayoutFunction · 0.90
useThemeColorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected