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

use-scroll-bar

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-scroll-bar - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

7

lib/scrollbar.js

@@ -25,5 +25,6 @@ "use strict";

}), data = _a[0], setData = _a[1];
var isSSR = typeof window === 'undefined';
// cache last horizontal and vertical scroll positions
var lastScrollX = window.scrollX;
var lastScrollY = window.scrollY;
var lastScrollX = isSSR ? 0 : window.scrollX;
var lastScrollY = isSSR ? 0 : window.scrollY;
var handler = function () {

@@ -50,3 +51,3 @@ var newScrollY = window.scrollY;

react_1.useEffect(function () {
if (typeof window !== 'undefined') {
if (!isSSR) {
window.addEventListener('scroll', handler);

@@ -53,0 +54,0 @@ return function () {

{
"name": "use-scroll-bar",
"version": "1.0.4",
"version": "1.0.5",
"description": "Get information of window scrollbar like current position and direction of last scroll.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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