@kait/use-media
v0.2.0
Published
Media queries. Powered by React hooks.
Downloads
5
Readme
@kait/use-media
Media queries. Powered by React hooks.
Install
# yarn
$ yarn add @kait/use-media
# npm
$ npm i @kait/use-media
Usage
import useMedia from '@kait/use-media'
function Drawer() {
const mobile = useMedia('(max-width: 640px)')
return <>{mobile ? <MobileDrawer /> : <DesktopDrawer />}</>
}