WellNuo/hooks/use-color-scheme.web.ts
Sergei cd8de4a7d4 Initial commit: Clean WellNuo Voice Assistant React Native Expo project
- Fresh Expo React Native application setup
- Default template with standard dependencies
- Ready for voice assistant development
- Connected to Gitea development branch

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-12 11:36:23 -08:00

22 lines
480 B
TypeScript

import { useEffect, useState } from 'react';
import { useColorScheme as useRNColorScheme } from 'react-native';
/**
* To support static rendering, this value needs to be re-calculated on the client side for web
*/
export function useColorScheme() {
const [hasHydrated, setHasHydrated] = useState(false);
useEffect(() => {
setHasHydrated(true);
}, []);
const colorScheme = useRNColorScheme();
if (hasHydrated) {
return colorScheme;
}
return 'light';
}