Package Exports
- @expo/match-media
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@expo/match-media) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
👋 Welcome to
@expo/match-media
Universal polyfill for match media API using Expo APIs on mobile
TL;DR: Demo;
🏁 Setup
Install @expo/match-media in your project.
yarn add @expo/match-mediaIf you're using a React Native app that wasn't bootstrapped with the
expo-clithen you'll need to install and link theexpomodule to use this package.
⚽️ Usage
Import the polyfill at the top of your file before using the [window.matchMedia API][match-media.
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.