use-hide-scrollbar
v1.0.19
Published
custom react hook to hide browser scrollbar
Downloads
34
Maintainers
Readme
use-hide-scrollbar
custom react hook to hide browser scrollbar
Install
yarn add use-hide-scrollbar
Usage
import React from 'react';
import {useHideScrollbar} from "use-hide-scrollbar";
const App = () => {
const [trigger, setTrigger] = useState(false);
useHideScrollbar(trigger);
console.log(trigger)
return (
<div>
<button onClick={() => setTrigger(prev => !prev)}>Click me!</button>
</div>
);
}
All you need is to pass a boolean as a parameter
useHideScrollbar(trigger);
Show your support
Give a ⭐️ if this project helped you!