Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/tuckerconnelly/react-native-match-media


https://github.com/tuckerconnelly/react-native-match-media

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

react-native-match-media
========================

`window.matchMedia` polyfill for React Native

Has a peer dependency of [walmartreact/react-native-orientation-listener](https://github.com/walmartreact/react-native-orientation-listener), so make sure that's installed first.

## Usage

```js
import matchMedia from 'react-native-match-media'

global.matchMedia = matchMedia
```

```js
if (global.matchMedia('(min-width: 400px)').matches) {
// Do something
}
```

## License
MIT