0.0.55 • Published 1 year ago

use-outside-click-hook v0.0.55

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React outside click hook

React use outside click hook. It's a simple hook that allows you to detect clicks outside of a component.

Simple example

import {useState} from 'react';
import useOutsideClick from 'use-outside-click-hook';

const ExampleComponent = () => {
  const [show, setIsClicked] = useState(false);

  const ref = useOutsideClick(() => {
    setIsClicked(true);
  });

  return (
    <div ref={ref}>
      {isClicked ? 'Clicked outside' : 'Waiting for click outside'}
    </div>
  );
};
0.0.55

1 year ago

0.0.54

1 year ago

0.0.53

1 year ago

0.0.52

1 year ago

0.0.51

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago