New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@diana-ui/hooks

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@diana-ui/hooks - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

2

lib/useOnClickOutside.d.ts
/// <reference types="react" />
declare function useOnClickOutside(ref: React.RefObject<HTMLElement | undefined>, onClickOutside: (target: HTMLElement) => void): void;
declare function useOnClickOutside(refs: React.RefObject<HTMLElement | undefined>[], onClickOutside: (target: HTMLElement) => void): void;
export default useOnClickOutside;
import { useEffect } from "react";
function useOnClickOutside(ref, onClickOutside) {
function useOnClickOutside(refs, onClickOutside) {
var handleClickOutside = function (event) {
var target = event.target;
if (ref.current && !ref.current.contains(target)) {
var hasClickedOutside = refs.every(function (ref) { return ref.current && !ref.current.contains(target); });
if (hasClickedOutside) {
onClickOutside(target);

@@ -7,0 +8,0 @@ }

/// <reference types="react" />
declare function useOnClickOutside(ref: React.RefObject<HTMLElement | undefined>, onClickOutside: (target: HTMLElement) => void): void;
declare function useOnClickOutside(refs: React.RefObject<HTMLElement | undefined>[], onClickOutside: (target: HTMLElement) => void): void;
export default useOnClickOutside;
import { useEffect } from "react";
function useOnClickOutside(ref, onClickOutside) {
function useOnClickOutside(refs, onClickOutside) {
const handleClickOutside = (event) => {
const target = event.target;
if (ref.current && !ref.current.contains(target)) {
const hasClickedOutside = refs.every(ref => ref.current && !ref.current.contains(target));
if (hasClickedOutside) {
onClickOutside(target);

@@ -7,0 +8,0 @@ }

{
"name": "@diana-ui/hooks",
"version": "0.1.3",
"version": "0.1.4",
"main": "lib/index.js",

@@ -28,3 +28,3 @@ "module": "module/index.js",

},
"gitHead": "e86821d8818d20611bf9af2238d579a411983821"
"gitHead": "7ef8c57f0220085ac2a07f7f97dfcfb7f665460f"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc