Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

outsideclick-react

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

outsideclick-react

A React component and a hook to detect outside click.

Source
npmnpm
Version
0.0.7
Version published
Weekly downloads
181
-43.08%
Maintainers
1
Weekly downloads
 
Created
Source

OutSideClick React

A React component and a hook to detect outside click.

Installation

npm i outsideclick-react

How to use

Use Hook

import React from "react";
import { useOutsideClick } from "outsideclick-react";

function Example() {
    const ref = useOutsideClick(handleOutsideClick)
    const handleOutsideClick = (e){
        console.log(e)
    }
    return(
        <div ref={ref}>
            <h1>Detect Outside Click</h1>
        </div>
    )
}
export default Example

Use React Component

import React from "react";
import { OutsideClick } from "outsideclick-react";

function Example() {
    const handleOutsideClick = (e){
        console.log(e)
    }
    return(
        <OutsideClick onOutsideClcik={handleOutsideClick}>
            <h1>Detect Outside Click</h1>
        </OutsideClick>
    )
}
export default Example

NB: OutsideClick react component return a div, It supports all div element property

Keywords

outsideclick

FAQs

Package last updated on 23 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts