I want to change the app color by mode of device whether if it is dark or light.
But I don't know how to check that my device is in dark mode or in light mode.
Please advice something.

You can do this with the Appearance module, via
import { Appearance } from 'react-native';
const colorScheme = Appearance.getColorScheme();
if (colorScheme === 'dark') {
// Use dark color scheme
}
You can also check whether the user has changed those settings by adding a listener like such:
static addChangeListener(listener)
Look here for the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With