Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

143
Vistas
React Native - Expo - How to check if Dark mode is enabled?

I have read in the Expo/RN documentation, that for getting the system color (dark/light) we should use this API from react native.

So, I have decided to create my custom hook

import { Appearance } from "react-native";

export default function useIsDarkModeEnabled() {
  return Appearance.getColorScheme() === "dark";
}

But for some reason, it is always returning me false. I am testing on iOS 14, with dark theme enabled.

Any ideas?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Whenever I check the current appearance of the device I use the useColorScheme() function, not getColorScheme().

You can use Context to persist it throughout the application, or put it at the root of your app and pass it down to your components as props (not the best). To persist the theme, you can use AsyncStorage to store the last state of the appearance.

Then whenever the application opens, it will pull that last state unless the device has changed its appearance since then.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda