Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
2 answers
1k views

My React Native app is lagging in the light mode, but is superfast in the dark

I am creating a React Native app with light and dark modes. The colors of all components in the app are controlled with my custom hook: export const useColors = (): UseColorsResult => { const ...
Anton L.'s user avatar
  • 798
2 votes
2 answers
2k views

dark mode interfering with background color

I'm trying to apply background colors to my app and for some reason I can't get the right colors for example: <View style={{backgroundColor:'yellow'}}></View> but I'm getting the first ...
user avatar
0 votes
2 answers
2k views

React-native dark theme in class based project

i am having trouble adding a dark-theme support to my react-native app. theme-context.js import React from 'react'; const themes = { dark: { backgroundColor: 'gray', ...
blendstylez's user avatar
0 votes
1 answer
1k views

How to set a theme based on the dark mode choice of the device?

I have two themes set up in styles.xml. When the app launches I want to set the appropriate theme based on the dark mode choice of the device. Let's say I want to have different colors for ...
Serdar's user avatar
  • 375
2 votes
3 answers
5k views

React Native Appearance.addChangeListener() does nothing

I am writing my first react-native app and would like to switch themes like GMail does. Indeed GMail get darker colors when we change the theme mode, or set automatic dark theme during nights, into ...
olive007's user avatar
  • 852
1 vote
2 answers
351 views

I'm trying to implement dark mode in react native

When trying to assign the variable "theme" (which receives the useColorScheme library) as a style, the following error is presented. Error image Light and dark styles were created in styles.js. ...
José Guilherme's user avatar
0 votes
1 answer
931 views

React-native: Is there way to listen to Color Scheme (Dark Mode) change?

The official guideline suggests checking if Dark Theme is enabled on each component render. This seems grossly wrong. Is there better way of keeping the dark mode up to date?
stkvtflw's user avatar
  • 13.4k
7 votes
1 answer
5k views

react native force light mode in android app

when I run my react native app in the emulator (pixel android 10), I noticed that the app change the white background to black when the phone set to dark mode. this made hard to read the black text or ...
Mohammad's user avatar
  • 103
1 vote
2 answers
4k views

How to activate the dark mode in react native app when android theme set to dark mode?

I am developing a react native app which supports dark theme. I used react navigation and created custom theme using React context. Now I can toggle between dark mode and light mode using a button. ...
Lakshan Mamalgaha's user avatar