react-clickoutsideme
v1.0.1
Published
A handler for capturing clicks outside a child element
Downloads
1
Readme
react-clickoutsideme
A handler for capturing clicks outside a child element
Install
npm install --save react-clickoutsideme
Usage
import React, { useCallback } from 'react'
import ClickOutsideMe from 'react-clickoutsideme'
const App = () => {
const onClickOutside = useCallback(() => {
alert('Clicked outside!')
}, [])
return (
<ClickOutsideMe onClickOutside={onClickOutside}>
<div>Click outside me!</div>
</ClickOutsideMe>
)
}
export default App
License
MIT © wagnerpaz