react-native-match-media-polyfill

window.matchMedia() polyfill for React Native

Usage no npm install needed!

<script type="module">
  import reactNativeMatchMediaPolyfill from 'https://cdn.skypack.dev/react-native-match-media-polyfill';
</script>

README

react-native-match-media-polyfill

window.matchMedia polyfill for React Native so you can use react-responsive or similar libs. also suports react-native-web

Installation

Open a Terminal in your project, and run:

yarn add react-native-match-media-polyfill

Usage

Import the polyfill at the top of your file before using the window.matchMedia API or at top of your index.js or App.js file

import 'react-native-match-media-polyfill'
// use the match media API

And we're done 🎉

LICENSE

MIT