We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Im trying to update theme-color meta tags after calling setTheme. However when i log the css background-color, it is still the older one. for ex.
theme-color
setTheme
background-color
useEffect(() => { const bgColor = getComputedStyle(document.body).getPropertyValue('background-color') console.log(bgColor) //white },[theme]) setTheme('dark')
However when i do the same log from chrome developer console after i do setTheme('dark'), i get black.
setTheme('dark')
So im assuming that this is some race condition. A solution could be to have a callback after the theme is set and the css classes are updated.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Im trying to update
theme-color
meta tags after callingsetTheme
. However when i log the cssbackground-color
, it is still the older one.for ex.
However when i do the same log from chrome developer console after i do
setTheme('dark')
, i get black.So im assuming that this is some race condition. A solution could be to have a callback after the theme is set and the css classes are updated.
The text was updated successfully, but these errors were encountered: