use-hide-scrollbar
TypeScript icon, indicating that this package has built-in type declarations

1.0.19 • Public • Published

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!

Package Sidebar

Install

npm i use-hide-scrollbar

Weekly Downloads

37

Version

1.0.19

License

MIT

Unpacked Size

3.72 kB

Total Files

9

Last publish

Collaborators

  • sarkis_kozanoghli