Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@radix-ui/react-compose-refs

Package Overview
Dependencies
Maintainers
6
Versions
77
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 1.1.1-rc.2 to 1.1.1-rc.3

4

dist/index.d.ts

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

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

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

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

@@ -49,6 +49,14 @@ "use strict";

return (node) => {
const cleanups = refs.map((ref) => setRef(ref, node));
if (cleanups.some((c) => typeof c == "function")) {
let hasCleanup = false;
const cleanups = refs.map((ref) => {
const cleanup = setRef(ref, node);
if (!hasCleanup && typeof cleanup == "function") {
hasCleanup = true;
}
return cleanup;
});
if (hasCleanup) {
return () => {
cleanups.forEach((cleanup, i) => {
for (let i = 0; i < cleanups.length; i++) {
const cleanup = cleanups[i];
if (typeof cleanup == "function") {

@@ -59,3 +67,3 @@ cleanup();

}
});
}
};

@@ -62,0 +70,0 @@ }

{
"name": "@radix-ui/react-compose-refs",
"version": "1.1.1-rc.2",
"version": "1.1.1-rc.3",
"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

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