Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!