
Research
npm Malware Targets Telegram Bot Developers with Persistent SSH Backdoors
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
@rooks/use-will-unmount
Advanced tools
npm install rooks
or
yarn add rooks
Rooks is completely treeshakeable and if you use only 1 of the 50+ hooks in the package, only that hook will be bundled with your code. Your bundle will only contain the hooks that you need. Cheers!
componentWillUnmount lifecycle as hook for React.
npm install --save @rooks/use-will-unmount
import useWillUnmount from "@rooks/use-will-unmount"
function Message(){
useWillUnmount(function () {
alert("unmounted")
})
return <p> Message </p>
}
function Demo() {
const [
value,
changeValue
] = useState(true);
function toggleValue(){
changeValue(!value)
}
return <>
<p><button onClick={toggleValue}>Toggle show </button></p>
{value && <Message/>}
</>;
}
render(<Demo/>)
Arguments | Type | Description | Default value |
---|---|---|---|
callback | function | Callback function which needs to run on unmount | undefined |
FAQs
A React hook for componentWillUnmount lifecycle method
The npm package @rooks/use-will-unmount receives a total of 349 weekly downloads. As such, @rooks/use-will-unmount popularity was classified as not popular.
We found that @rooks/use-will-unmount 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
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
Security News
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.