Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
auto-hide-hook
Advanced tools
Readme
This is a React hook that will hide mobile menu dropdown bar if you click, touch or scroll outside of the dropdown menu.
To use this hook you need to set a useRef to the element you want use as a reference and a setShow function to set the state of the element you want to hide. The hook will return a function that will hide the element when you click, touch or scroll outside of the element.
npm i auto-hide-hook
or
yarn add auto-hide-hook
import useAutoHide from 'auto-hide-hook';
useAutoHide(ref, setShow);
import React, { useRef, useState } from 'react';
import useAutoHide from 'auto-hide-hook';
const App = () => {
const [show, setShow] = useState(false);
const ref = useRef(null);
useAutoHide(ref, setShow);
return (
<div ref={ref}>
<div className={show ? 'show' : 'hide'}>Hello World</div>
<button onClick={() => setShow(!show)}>Toggle</button>
</div>
);
};
export default App;
.hide {
display: none;
}
.show {
display: block;
}
Raul Jimenez
FAQs
Autohide is a hook that close mobile menu dropdown bar when you scroll down or click outside the dropdown bar
The npm package auto-hide-hook receives a total of 1 weekly downloads. As such, auto-hide-hook popularity was classified as not popular.
We found that auto-hide-hook 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.