🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@radix-ui/react-compose-refs

Package Overview
Dependencies
Maintainers
6
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-compose-refs - npm Package Compare versions

Comparing version

to
1.1.1-rc.2

4

dist/index.d.ts

@@ -8,3 +8,3 @@ import * as React from 'react';

*/
declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T) => () => void;
declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T) => (() => void) | undefined;
/**

@@ -14,4 +14,4 @@ * A custom hook that composes multiple refs

*/
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): (node: T) => () => void;
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): (node: T) => (() => void) | undefined;
export { composeRefs, useComposedRefs };

@@ -50,11 +50,13 @@ "use strict";

const cleanups = refs.map((ref) => setRef(ref, node));
return () => {
cleanups.forEach((cleanup, i) => {
if (typeof cleanup == "function") {
cleanup();
} else {
setRef(refs[i], null);
}
});
};
if (cleanups.some((c) => typeof c == "function")) {
return () => {
cleanups.forEach((cleanup, i) => {
if (typeof cleanup == "function") {
cleanup();
} else {
setRef(refs[i], null);
}
});
};
}
};

@@ -61,0 +63,0 @@ }

{
"name": "@radix-ui/react-compose-refs",
"version": "1.1.1-rc.1",
"version": "1.1.1-rc.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "exports": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet