1.0.3 • Published 4 years ago

usemobileonly v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

useMobileOnly

A small hook on Material-UI breakpoints

Simply it checks breakpoint with useMediaQuery hook and turn query result.

Basic usage

import useMobileOnly from 'usemobileonly'

const TestComp = () => {
  const isMobileOnly = useMobileOnly()
  {isMobileOnly ? <p>Mobile Screen</p> : <span>Non-Mobile Screen</span>} 
}

If you don't want to add another lib to your work just check the source. You can understand UI size changes just using the useMediaQuery hook of Material-UI.