expo / react-native-appearance

Access operating system appearance information (currently only light/dark mode) on iOS, Android, and web
MIT License
337 stars 40 forks source link

theme is not changing when using useLayoutEffect #62

Open elie-chaaban opened 3 years ago

elie-chaaban commented 3 years ago

Hello,

I have this code in a screen:

import { useTheme } from "@react-navigation/native"; const { colors } = useTheme(); useLayoutEffect(() => { navigation.setOptions({ headerRight: () => ( <Text styles={color: colors.text}}>TEST ), }); }, [badge]);

If I go and change the iPhone settings to dark or light, the text does not change unless i refresh the page or hot reload when using expo, how can i solve it, everything is working perfectly except such thing