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.
- Host: GitHub
- URL: https://github.com/beanloop/react-with-media
- Owner: beanloop
- License: other
- Created: 2017-01-10T16:15:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-03T14:51:09.000Z (almost 9 years ago)
- Last Synced: 2025-01-05T09:30:39.096Z (about 1 year ago)
- Topics: higher-order-component, media-queries
- Language: TypeScript
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# react-with-media
[](https://travis-ci.org/beanloop/react-with-media)
[](https://badge.fury.io/js/react-with-media)
[](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.