Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 808 Bytes

README.md

File metadata and controls

28 lines (23 loc) · 808 Bytes

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.