Skip to content

beanloop/react-with-media

Repository files navigation

react-with-media

Build Status npm version License

React HOC for watching media queries.

Install

yarn add react-with-media
npm install --save react-with-media

Usage

const ShowMessage = withMedia('(max-width: 500px)')(({matches}) =>
  matches
    ? <span>Is mobile</span>
    : <span>Is desktop</span>
  )

API Docs

Documentation can be found here.

License

react-with-media is dual-licensed under Apache 2.0 and MIT terms.

Releases

No releases published

Packages

No packages published