mirror of
https://github.com/zhigang1992/match-media.git
synced 2026-01-12 17:32:22 +08:00
master
👋 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-media
If 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.
import '@expo/match-media';
// use the match media API
What 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.
Languages
TypeScript
45.1%
JavaScript
28.4%
Shell
26.5%