@liandro-wesley/use-media-query
v1.1.2
Published
A package for you to use in your projects with React JS or Next JS. Basically, it provides a boolean return for the set breakpoints
Downloads
2
Readme
UseMediaQuery
A package for you to use in your projects with React JS or Next JS. Basically, it provides a boolean return for the set breakpoints
Install
# NPM
npm install --save @liandro-wesley/use-media-query
# YARN
yarn add @liandro-wesley/use-media-query
Usage
import React from 'react'
import useMediaQuery from 'use-media-query'
const Example: React.FC = () => {
const isMobile = useMediaQuery('(max-width: 425px)')
return (
<div>
You are on: {isMobile ? 'Mobile' : 'Desktop'}
<span>If this was helpful to you, could you please give this repository a star?</span>
</div>
)
}
Follow me
License
MIT © liandro-wesley