Skip to content
matchMedia React hook
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.eslintignore
.eslintrc.yml
.flowconfig
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.md
README.md
babel.config.js
package.json
prettier.config.js
release.config.js
rollup.config.js
yarn.lock

README.md

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;
}
You can’t perform that action at this time.