-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add a direct theme
prop?
#7
Comments
If you update the underneath dependency |
SSR does not know about user preference on the browser side. |
Thanks
That's true but the browser preference should be applied after hydration no?
Even if I try to force the light theme, the button remains dark after
client hydration.
I think it would be better to set the right theme after hydration, even if
it could lead to a flash of bad theme at hydration time at least we have
the correct color in the end
Le lun. 1 juin 2020 à 19:47, なつき <notifications@github.com> a écrit :
… Closed #7 <#7>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFW6PSNFM2Q5O2M2HD6L53RUPSUXANCNFSM4NP6UAQA>
.
|
Unfortunately, that is a problem in react: |
Quoted from facebook/react#10591:
|
1e68366a6a8b0092d769f2a056973e08f44520a5 |
Hi,
I added this button to a React SPA with a dark mode toggle (Docusaurus v2). The button theme should change when the theme is toggled, and we should "decorelate" to the initial user preferenced stored in the browser.
This leads to unnatural integration where I have to provide a "mapping", while I know exactly which theme for the button I want.
(more context here: typescript-cheatsheets/react#233)
The text was updated successfully, but these errors were encountered: