0.1.2 • Published 4 years ago
@koheimukai/react-media-query v0.1.2
react-media-query
a package that allows you to see if a given media query matches
Install
npm install --save react-media-query
Usage
import React, { Component } from 'react'
import { useMediaQuery } from '@koheimukai/react-media-query'
const Example = () => {
const matches = useMediaQuery('(max-width: 600px)')
return (
<div>{matches && <span>Mobile</span>}</div>
)
}
License
This hook is created using create-react-hook.