Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-mouse-aware
Advanced tools
A tiny higher order component to track mouse state.
import { Component } from 'react';
import { mouseAware } from 'react-mouse-aware';
@mouseAware({ // same as default options
inDelay: 0,
outDelay: 0,
inHandler: 'onMouseEnter',
outHandler: 'onMouseLeave',
key: 'isOver'
})
@mouseAware({
inDelay: 300,
outDelay: 100,
inHandler: 'onMouseDown',
outHandler: 'onMouseUp',
key: 'isPressed'
})
class CustomComponent extends Component {
render() {
// props will include the in and out handlers
let { isOver, isPressed, className, ...props } = this.props;
if (isOver) className += ' hovered'; // mouse is over component
if (isPressed) className += ' active'; // mouse has been held down for 300ms or was just released
return (
<div {...props} className={className}>
</div>
)
}
};
@mouseAware(options)
export default class Test extends React.Component {
/* your code */
}
class Test extends React.Component {
/* your code */
}
export default mouseAware(options)(Test);
inDelay
defaults to 0
Time in ms
to wait before setting the active
status to true
.
outDelay
defaults to 0
Time in ms
to wait before setting the active
status to false
.
inHandler
defaults to 'onMouseEnter'
Property name to expose the inHandler
as.
outHandler
defaults to 'onMouseLeave'
Property name to expose the outHandler
as.
openFunction
no defaultProperty name to expose the force open function as. This function will ignore the in delay
closeFunction
no defaultProperty name to expose the force close function as. This function will ignore the out delay.
key
defaults to 'isOver'
Property name to expose the active
status as.
FAQs
A tiny higher order component to track mouse state.
The npm package react-mouse-aware receives a total of 453 weekly downloads. As such, react-mouse-aware popularity was classified as not popular.
We found that react-mouse-aware 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.