
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
react-micro-match-media
Advanced tools
> zero dependencies, ~1kb render prop wrapper of window.matchMedia
zero dependencies, ~1kb render prop wrapper of window.matchMedia
$ npm install --save react-micro-match-media
This package expect react@^16.3.0 as a peer dependency.
You just pass in the query that you want to be listening and render your components accordingly.
import React, { Component } from 'react'
import MatchMedia from 'react-micro-match-media'
const App = () => (
<MatchMedia query={`(max-width: 600px)`}>
{matches => {
if (matches) return 'will be rendered if viewport is <= 600'
return 'will be rendered if viewport is > 600'
}}
</MatchMedia>
)
You can also do things like:
import React, { Component } from 'react'
import MatchMedia from 'react-micro-match-media'
const Portrait = ({ children, ...props }) => (
<MatchMedia {...props} query={`(orientation: portrait)`}>
{isPortrait => (isPortrait ? children : null)}
</MatchMedia>
)
const App = () => (
<Portrait>will render only if orientation is portrait</Portrait>
)
FAQs
> zero dependencies, ~1kb render prop wrapper of window.matchMedia
The npm package react-micro-match-media receives a total of 135 weekly downloads. As such, react-micro-match-media popularity was classified as not popular.
We found that react-micro-match-media demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.