@jdthornton/useonclickoutside
v1.1.3
Published
React on click outside ref target hook
Downloads
3
Readme
@jdthornton/useonclickoutside
React on click outside ref target hook.
Install
$ npm install @jdthornton/useonclickoutside
Usage
import useOnClickOutside from "@jdthornton/useonclickoutside";
function App({ handleClickOutside }){
const ref = useRef();
useOnClickOutside(ref, handleClickOutside)
return(
<div ref={ref}>
Don't click outside!
</div>
)
}