Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-media-hook

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-media-hook - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

dist/useMediaPredicate.js

10

dist/index.js

@@ -12,3 +12,11 @@ "use strict";

});
Object.defineProperty(exports, "useMediaPredicate", {
enumerable: true,
get: function get() {
return _useMediaPredicate.useMediaPredicate;
}
});
var _useMedia = require("./useMedia");
var _useMedia = require("./useMedia");
var _useMediaPredicate = require("./useMediaPredicate");

4

package.json
{
"name": "react-media-hook",
"version": "0.1.2",
"version": "0.2.0",
"description": "React Hook for media query",

@@ -58,2 +58,2 @@ "main": "./dist/index.js",

}
}
}

@@ -22,11 +22,10 @@ # react-media-hook

Pass query to *useMedia*:
Pass query to *useMediaPredicate*:
```javascript
import React from "react";
import { useMedia } from "react-media-hook";
import { useMediaPredicate } from "react-media-hook";
const Component = () => {
const mediaResult = useMedia("(min-width: 400px)");
const biggerThan400 = mediaResult && mediaResult.matches;
const biggerThan400 = useMediaPredicate("(min-width: 400px)");

@@ -44,3 +43,3 @@ return <div>

Returns *undefined* (for example, in Node.js environment
where *mathMedia* is not defined), or object:
where *mathMedia* is not defined), or object, simular to *mathMedia(...)* result:
```javascript

@@ -51,2 +50,5 @@ {

}
```
```
#### `useMediaPredicate(query: string)`
Returns just *true* or *false*.
// @flow
export {useMedia} from "./useMedia";
export { useMedia } from "./useMedia";
export { useMediaPredicate } from "./useMediaPredicate"

Sorry, the diff of this file is not supported yet

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