a package that allows you to see if a given media query matches
npm install --save react-media-query
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>
)
}
This hook is created using create-react-hook.