New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-media-query-hoc

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-media-query-hoc

A dead simple React Higher Order Component (HOC) that uses context for matching media queries

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-7.5%
Maintainers
1
Weekly downloads
 
Created
Source

react-media-query-hoc

A dead simple React Higher Order Component (HOC) that uses context for matching media queries

Why ?

  • Easy to test:
  • Performance: you can wrap your whole parent component in the HOC - and only have matchMedia event listeners firing for the number of screens you wish to configure

Usage

Thanks

Big thanks to the maintainers of these repos

  • https://github.com/jxnblk/react-media-context
  • https://github.com/contra/react-responsive

Both libraries are a bit simular to this library .. but my original use case required:

  • A simpler API where you didnt need to put MediaQuery components all over your code base
  • More performant (you only need 1 parent MediaQueryProvider that listens to screen events)
  • Easier to test (react-responsive in particular is hard to test with)
  • Used which also used matchmedia (Media queries for client and server)
  • Abstracted away React context which is experimental

Keywords

FAQs

Package last updated on 08 Jun 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc