https://github.com/vlazh/react-outside-click-listener
Outside click listener for React
https://github.com/vlazh/react-outside-click-listener
component javascript outside outside-click outsideclick react typescript
Last synced: 3 months ago
JSON representation
Outside click listener for React
- Host: GitHub
- URL: https://github.com/vlazh/react-outside-click-listener
- Owner: vlazh
- License: mit
- Created: 2020-05-23T04:57:39.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-11T15:23:29.000Z (5 months ago)
- Last Synced: 2025-03-24T11:07:18.312Z (3 months ago)
- Topics: component, javascript, outside, outside-click, outsideclick, react, typescript
- Language: TypeScript
- Homepage:
- Size: 357 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Outside click listener for React
[](https://www.npmjs.org/package/react-outside-click-listener)
## Installation
```sh
npm install --save react-outside-click-listener
# or
yarn add react-outside-click-listener
```## Usage example
```tsx
import { OutsideClickListener } from 'react-outside-click-listener';function MyComponent() {
return (
{/* Child must hold a ref to dom node. */}
);
}
```