liringlas / react-match-mq

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple media query matching component

IE10+ because of window.matchMedia(...)

Usage:

npm i --save react-match-mq

OR

yarn add react-match-mq

Simple true/false rendering.

import { Media } from 'react-match-mq';
...
<Media query={"(min-width: 1024px)"}>
    {matches =>
        matches ? (
            "It matches!"
        ) : (
            "Doesnt match"
        )
    }
</Media>

About


Languages

Language:JavaScript 51.7%Language:TypeScript 48.3%