use-mq
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

use-mq

Build Status Greenkeeper badge

matchMedia React hook

Installation

  • npm: npm install --save use-mq
  • yarn: yarn add use-mq

Usage

import { useMQ } from 'use-mq';
 
const MyComponent = () => {
  const matches = useMQ('(min-width: 400px)');
 
  return matches
    ? <div>Matches!</div>
    : null;
}

Readme

Keywords

none

Package Sidebar

Install

npm i use-mq

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

6.38 kB

Total Files

10

Last publish

Collaborators

  • bigslycat