Brandon Presley
31f1528c35
The settings context was having a big performance impact on the app. We only truly need the theme + color to be a global context.
12 lines
281 B
TypeScript
12 lines
281 B
TypeScript
import {useColorScheme} from 'react-native'
|
|
import {useTheme} from './use-theme'
|
|
|
|
export default function useDark() {
|
|
const dark = useColorScheme() === 'dark'
|
|
const {theme} = useTheme()
|
|
|
|
if (theme === 'dark') return true
|
|
if (theme === 'light') return false
|
|
return dark
|
|
}
|