Using useColorScheme:
1import { useColorScheme } from "react-native";23function App() {4 const colorScheme = useColorScheme();5 const isDark = colorScheme === "dark";67 return (8 <View style={{ backgroundColor: isDark ? "#000" : "#fff" }}>9 <Text style={{ color: isDark ? "#fff" : "#000" }}>Hello</Text>10 </View>11 );12}
With React Navigation:
1const MyTheme = {2 dark: true,3 colors: {4 primary: "#fff",5 background: "#000",6 card: "#111",7 text: "#fff",8 },9};
Best practices: