-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
When I refresh the page useMedia will break my UI (Remove css) #1885
Comments
In above video you can see that when I refresh on the mobile view it will apply style of desktop view that is |
Maybe it's because of React 16's new SSR strategy? facebook/react#10591. |
Same issue here |
same to me |
13 tasks
Shouldn't this issue be closed with #2216? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I implemented useMedia() from
react-use
so when I check desktop to mobile then it is working fine but when I refresh on mobile then it will remove my css**
import React, { FC } from 'react'
import { useMedia } from 'react-use'
const Index: FC = () => {
const isMobile = useMedia('(max-width: 768px)', false);
return (
{isMobile ? (
)
}
.mobile-view {
background-color: aquamarine !important;
}
.desktop-view {
background-color: red;
}
**
Bug issue video:- https://www.awesomescreenshot.com/video/3078205?key=fd357595486a738f6fff5fea636a7597
Version
The text was updated successfully, but these errors were encountered: