An open API service indexing awesome lists of open source software.

https://github.com/beanloop/react-with-media

React HOC for watching media queries.
https://github.com/beanloop/react-with-media

higher-order-component media-queries

Last synced: 11 months ago
JSON representation

React HOC for watching media queries.

Awesome Lists containing this project

README

          

# react-with-media
[![Build Status](https://travis-ci.org/beanloop/react-with-media.svg?branch=master)](https://travis-ci.org/beanloop/react-with-media)
[![npm version](https://badge.fury.io/js/react-with-media.svg)](https://badge.fury.io/js/react-with-media)
[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)

React HOC for watching media queries.

## Install
```
yarn add react-with-media
npm install --save react-with-media
```

## Usage
```typescript
const ShowMessage = withMedia('(max-width: 500px)')(({matches}) =>
matches
? Is mobile
: Is desktop
)
```

## API Docs
Documentation can be found [here](https://beanloop.github.io/react-with-media/).

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