How to use the @rooks/use-outside-click function in @rooks/use-outside-click

To help you get started, we’ve selected a few @rooks/use-outside-click examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imbhargav5 / rooks / packages / storybook / src / outside-click.js View on Github external
function UseOutsideClickDemo() {
  const pRef = useRef();
  function outsidePClick() {
    alert("Clicked outside.");
  }
  useOutsideClick(pRef, outsidePClick);
  return (
    <div>
      <span style="{{">
        Click outside me
      </span>
    </div>

@rooks/use-outside-click

React hook for tracking clicks outside a ref

MIT
Latest version published 4 years ago

Package Health Score

59 / 100
Full package analysis

Popular @rooks/use-outside-click functions