React hook for tracking clicks outside a ref
npm install @rooks/use-outside-click```
npm install rooks
or
``
yarn add rooks
Rooks is completely treeshakeable and if you use only 1 of the 50+ hooks in the package, only that hook will be bundled with your code. Your bundle will only contain the hooks that you need. Cheers!
!Build Status   
``
npm install --save @rooks/use-outside-click
`javascript`
import useOutsideClick from "@rooks/use-outside-click";
` Click outside mejsx
function Demo() {
const pRef = useRef();
function outsidePClick() {
alert("Clicked outside p");
}
useOutsideClick(pRef, outsidePClick);
return (
);
}
render(
``