Skip to content
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

feat: useMobile hook #422

Merged
merged 3 commits into from
Feb 20, 2023
Merged

feat: useMobile hook #422

merged 3 commits into from
Feb 20, 2023

Conversation

MadCcc
Copy link
Member

@MadCcc MadCcc commented Feb 20, 2023

No description provided.

@vercel
Copy link

vercel bot commented Feb 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
util ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 20, 2023 at 9:52AM (UTC)

const useMobile = (): boolean => {
const [mobile, setMobile] = useState(false);

useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可能 useLayoutEffect 会更好,因为 effect 会闪一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants