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

@peersyst/react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peersyst/react-hooks - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

8

esm/usePreventBodyScroll.js
import { useEffect } from "react";
export default function usePreventBodyScroll(prevent) {
useEffect(function () {
if (prevent) document.body.style.overflow = "hidden";else document.body.style.removeProperty("overflow");
if (prevent) {
document.body.style.overflow = "hidden";
document.documentElement.style.overflow = "hidden";
} else {
document.body.style.removeProperty("overflow");
document.documentElement.style.removeProperty("overflow");
}
}, [prevent]);
}
import { useEffect } from "react";
export default function usePreventBodyScroll(prevent) {
useEffect(function () {
if (prevent) document.body.style.overflow = "hidden";else document.body.style.removeProperty("overflow");
if (prevent) {
document.body.style.overflow = "hidden";
document.documentElement.style.overflow = "hidden";
} else {
document.body.style.removeProperty("overflow");
document.documentElement.style.removeProperty("overflow");
}
}, [prevent]);
}
import { useEffect } from "react";
export default function usePreventBodyScroll(prevent) {
useEffect(function () {
if (prevent) document.body.style.overflow = "hidden";else document.body.style.removeProperty("overflow");
if (prevent) {
document.body.style.overflow = "hidden";
document.documentElement.style.overflow = "hidden";
} else {
document.body.style.removeProperty("overflow");
document.documentElement.style.removeProperty("overflow");
}
}, [prevent]);
}

@@ -12,4 +12,10 @@ "use strict";

(0, _react.useEffect)(function () {
if (prevent) document.body.style.overflow = "hidden";else document.body.style.removeProperty("overflow");
if (prevent) {
document.body.style.overflow = "hidden";
document.documentElement.style.overflow = "hidden";
} else {
document.body.style.removeProperty("overflow");
document.documentElement.style.removeProperty("overflow");
}
}, [prevent]);
}

2

package.json
{
"name": "@peersyst/react-hooks",
"author": "Peersyst",
"version": "1.1.1",
"version": "1.1.2",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "./node/index.js",

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