@expo/match-media
v0.4.0
Published
Universal polyfill for match media API using Expo APIs on mobile
Readme
TL;DR: Demo
🏁 Setup
Install @expo/match-media and expo-screen-orientation in your project.
npx expo install @expo/match-media expo-screen-orientation⚽️ Usage
Import the polyfill at the top of your file before using the window.matchMedia API.
import '@expo/match-media';
// use the match media APIWhat this does
- In the browser: Nothing
- In React Native apps: Polyfills the
matchMediaAPI so you can use awesome libraries likereact-responsive.
License
The Expo source code is made available under the MIT license. Some of the dependencies are licensed differently, with the BSD license, for example.
