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
useColorScheme always returns 'light', and then after that it will return the correct color scheme.
https://github.com/mantinedev/mantine/blob/703bf447b1a751daee7f3c2fff9c418bd13f5779/packages/%40mantine/hooks/src/use-media-query/use-media-query.ts#L24C2-L26C4 I believe the code above to be the problem. I only see useColorScheme and useReducedMotion actually using useMediaQuery... I think removing these lines won't break anything and will fix the problem.
useColorScheme
useReducedMotion
useMediaQuery
Why are we returning the initialValue only if its a boolean? I don't understand the purpose of this.
The text was updated successfully, but these errors were encountered:
!!! P.S I am not using SSR
Sorry, something went wrong.
[@mantine/hooks] use-media-query: Fix getInitialValueInEffect not w…
getInitialValueInEffect
37d5346
…orking correctly when initial value is provided (#5575)
923b8e1
…orking correctly when initial value is provided (#5575, #5549)
Fixed in 7.4.2
Just tested it on 7.4.2, it's not fixed. Actually I just need to use getInitialValueInEffect: false
getInitialValueInEffect: false
No branches or pull requests
useColorScheme always returns 'light', and then after that it will return the correct color scheme.
Possible fix
https://github.com/mantinedev/mantine/blob/703bf447b1a751daee7f3c2fff9c418bd13f5779/packages/%40mantine/hooks/src/use-media-query/use-media-query.ts#L24C2-L26C4
I believe the code above to be the problem. I only see
useColorScheme
anduseReducedMotion
actually usinguseMediaQuery
... I think removing these lines won't break anything and will fix the problem.Why are we returning the initialValue only if its a boolean? I don't understand the purpose of this.
The text was updated successfully, but these errors were encountered: