Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native 0.62.2 Appearance return wrong color scheme

Tags:

react-native

On iOS simulator (13.3) and Android 10

I have an issue with Appearance and useColorScheme when I set up dark mode it's still returned "light".

import { useColorScheme, Appearance } from 'react-native';

const colorScheme = useColorScheme();
console.log(colorScheme, Appearance.getColorScheme()) // "light", "light"

Am I doing something wrong?

like image 872
ArtemKh Avatar asked Nov 27 '22 13:11

ArtemKh


1 Answers

I found the problem.

Problem related to this pull request https://github.com/facebook/react-native/commit/f7b90336be25b78935549aa140131d4d6d133f7b - when debugger is active you will always get "light" theme. Just close debugger and everything will be good.

like image 192
ArtemKh Avatar answered Feb 24 '23 14:02

ArtemKh