use-match-media-query

1.0.1 • Public • Published

use-match-media-query

package version package downloads standard-readme compliant package license make a pull request JavaScript Style Guide

Match Media as a React hook!

Table of Contents

Usage

import {useMatchMediaQuery} from 'use-match-media-query'

const Comp = () => {
    const isMobile = useMatchMediaQuery('screen and (max-width: 60em')
    return isMobile ? 'on mobile' : 'not on mobile'
}

Install

This project uses node and npm.

$ npm install use-match-media-query
$ # OR
$ yarn add use-match-media-query

Safari

Having issues on Safari? You are not alone!.

Polyfills

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am "Add some feature"
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i use-match-media-query

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

4.07 kB

Total Files

4

Last publish

Collaborators

  • tiaanduplessis