
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
react-use-media-query
Advanced tools
`react-use-media-query` is a React Hook that help you to render content conditionally based on a media query, by listening for matches to a [CSS media query](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries).
react-use-media-query is a React Hook that help you to render content conditionally based on a media query, by listening for matches to a CSS media query.
Using npm:
npm i react-use-media-query
Using yarn:
yarn add react-use-media-query
import React from "react";
import useMediaQuery from "react-use-media-query";
const App = () => {
const isMobile = useMediaQuery("(max-width: 480px)");
return (
<>
{isMobile ? <p>mobile</p> : <p>desktop</p>}
</>
)
};
useMediaQuery(query, defaultMatch)
query: can be a string, an object e.g. {minWidth: 100, maxWidth: 200}, {screen: true}, {minWidth: 100, maxWidth: '20em'} or an array of objects e.g. [{screen: true, minWidth: 100}, {handheld: true, orientation: 'landscape'}].
defaultMatch: is the default boolean returned value.
FAQs
`react-use-media-query` is a React Hook that help you to render content conditionally based on a media query, by listening for matches to a [CSS media query](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries).
The npm package react-use-media-query receives a total of 2 weekly downloads. As such, react-use-media-query popularity was classified as not popular.
We found that react-use-media-query 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.