react-justu
v1.0.2
Published
A cool library that contains set of tools for common implementations ## Installation
Downloads
7
Maintainers
Readme
react-justu
A cool library that contains set of tools for common implementations
Installation
Using npm:
$ npm i react-justu --save-dev
Using yarn:
$ yarn add -D react-justu
Usage
import { useRef } from "react";
import { useClickOutside } from "react-justu";
export const MyComponent = () => {
const wrapperRef = useRef(null);
const doSomething = () => {
alert("hello");
};
useClickOutside(wrapperRef, doSomething);
return (
<div>
<div ref={wrapperRef}>Click outside</div>
</div>
);
};