Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
react-scrollbar-size
Advanced tools
React-Scrollbar-Size is a React component designed to calculate the size of the user agent's horizontal and vertical scrollbars. It will also detect when the size of the scrollbars changes, such as when the user agent's zoom factor changes.
React-Scrollbar-Size is available as an npm package:
$ npm install --save react-scrollbar-size
Name | Description |
---|---|
onLoad | Callback which will fire when the component mounts. |
onChange | Callback which will fire when the scrollbar sizes change. |
Each of the callbacks accepts an object which will be updated with the following properties:
Name | Description |
---|---|
scrollbarWidth | The current width of the vertical scrollbar. |
scrollbarHeight | The current height of the horizontal scrollbar. |
import React, { Component } from 'react';
import ScrollbarSize from 'react-scrollbar-size';
class MyComponent extends Component {
scrollbarSizeLoad = (measurements) => {
console.log('Scrollbars loaded', measurements);
}
scrollbarSizeChange = (measurements) => {
console.log('Scrollbars changed', measurements);
}
render() {
return (
<div>
<ScrollbarSize
onLoad={this.scrollbarSizeLoad}
onChange={this.scrollbarSizeChange}
/>
</div>
);
}
}
To see a live example, follow these instructions.
This project is licensed under the terms of the MIT license.
[1.0.1] - 2017-04-26
FAQs
React hook to calculate the size of browser scrollbars
The npm package react-scrollbar-size receives a total of 9,740 weekly downloads. As such, react-scrollbar-size popularity was classified as popular.
We found that react-scrollbar-size 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.