useColorMode
useColorMode is a custom hook which return current color mode.
Import
To use the useColorMode in your project, import useColorMode from @gluestack-style/react. as Demonstrated below.
import { useColorMode } from "@gluestack-style/react"
Let's use our useColorMode value to give background color to View from react-native.
import { View } from "react-native"
import { useColorMode } from "@gluestack-style/react"
const colorMode = useColorMode()
backgroundColor: colorMode === "light" ? "white" : "black",