UNPKG

usemobileonly

Version:

a small hook to determine window size is mobile or not depending on material-ui breakpoints

8 lines (6 loc) 207 B
const { useTheme, useMediaQuery } = require('@material-ui/core') function useMobileOnly () { const theme = useTheme() return useMediaQuery(theme.breakpoints.down('xs')) } module.exports = useMobileOnly