Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tuckerconnelly/react-native-match-media
https://github.com/tuckerconnelly/react-native-match-media
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tuckerconnelly/react-native-match-media
- Owner: tuckerconnelly
- License: mit
- Created: 2016-03-24T15:20:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-16T08:43:51.000Z (over 6 years ago)
- Last Synced: 2024-06-16T05:28:51.839Z (5 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 30
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-react-native - react-native-match-media ★23 - window.matchMedia mock for React Native (Components / UI)
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