-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there way not to use system color prefer state as default value? #60
Comments
According to the docs it looks like you could pass initialState as false.
If that's getting overridden by the system default then maybe you could
call a useEffect() hook with an empty array [] as the second parameter so
it only runs once in page load. In that you'd do dark mode.disable to force
it.
Best regards,
Derek
Derek R. Austin, PT, DPT, MS, BCTMB, LMT, CSCS
Read my blog on Medium: https://medium.com/@DoctorDerek
Join me on LinkedIn: https://www.linkedin.com/in/derek-austin/
…On Tue, Sep 22, 2020, 12:10 PM John Thachil ***@***.***> wrote:
if system prefer value is in dark mode the react app by default will start
in dark mode is there any way the default value is always light mode?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#60>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMV42QV4CWJ52RHUF4BFIBLSHDD6JANCNFSM4RV64JYQ>
.
|
@djD-REK Got it. But the edge case here is even if the the default value is false and if system theme preference is set in auto. During the time system switch from light mode -> dark mode the react app will get changed to dark mode. Anyway I can enforce the change in theme is only by user action in the app. |
I just modified the matchMedia of the window object to null as a work around
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if system prefer value is in dark mode the react app by default will start in dark mode is there any way the default value is always light mode?
The text was updated successfully, but these errors were encountered: