Created
October 5, 2022 21:27
-
-
Save ZhouYang1993/156eab5bb8993170508d6875eff4d76c to your computer and use it in GitHub Desktop.
Detect Mobile Browsers in React
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ResponsiveUI() { | |
return ( | |
window.screen.width >= 600 ? ( | |
// an UI component for desktop browsers | |
) : ( | |
// an UI component for mobile browsers | |
) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment