
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
react-detectable-overflow
Advanced tools
A React component that informs when the overflowed status is changed.
A React component which is able to detect changes in the state that the contents is overflowed.
npm install react-detectable-overflow
or
yarn add react-detectable-overflow
prop | required | type | description | default |
---|---|---|---|---|
tag | string | element type (e.g. 'p' , 'div' ) | 'div' | |
style | object | css style of the element | { width: '100%', textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden', } | |
className | string | class names | '' | |
onChange | (isOverflowed: boolean) => void | callback function called when its overflowing status is changed |
import * as React from 'react';
import DetectableOverflow from 'react-detectable-overflow';
class SampleComponent extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
}
handleChange(isOverflowed) {
// do something
}
render {
return (
<DetectableOverflow onChange={this.handleChange}>
This is a sample text.
</DetectableOverflow>
);
}
}
Be careful when you change the length of children
contents by onChange callback. The following code perhaps causes the infinite loop of changing isOverflowed
state.
// DO NOT WRITE LIKE THIS!
<DetectableOverflow
onChange={(isOverflowed) => {
if (isOverflowed) {
this.setState({ value: 'short' });
} else {
this.setState({ value: 'loooooooooooooooooooooooooooooooooooooong' });
}
}}
>
{this.state.value}
</DetectableOverflow>
This package is released under the MIT License, see LICENSE
FAQs
React hook/component to detect overflow state
The npm package react-detectable-overflow receives a total of 8,935 weekly downloads. As such, react-detectable-overflow popularity was classified as popular.
We found that react-detectable-overflow 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.