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

@radix-ui/react-slot

Package Overview
Dependencies
Maintainers
6
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-slot - npm Package Compare versions

Comparing version 1.1.0-rc.3 to 1.1.0-rc.4

3

dist/index.d.ts

@@ -0,1 +1,2 @@

import * as react_jsx_runtime from 'react/jsx-runtime';
import * as React from 'react';

@@ -9,5 +10,5 @@

children: React.ReactNode;
}) => JSX.Element;
}) => react_jsx_runtime.JSX.Element;
declare const Root: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
export { Root, Slot, type SlotProps, Slottable };

@@ -65,5 +65,7 @@ "use strict";

if (React.isValidElement(children)) {
const childrenRef = getElementRef(children);
return React.cloneElement(children, {
...mergeProps(slotProps, children.props),
ref: forwardedRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, children.ref) : children.ref
// @ts-ignore
ref: forwardedRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : childrenRef
});

@@ -103,3 +105,16 @@ }

}
function getElementRef(element) {
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
if (mayWarn) {
return element.ref;
}
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
if (mayWarn) {
return element.props.ref;
}
return element.props.ref || element.ref;
}
var Root = Slot;
//# sourceMappingURL=index.js.map
{
"name": "@radix-ui/react-slot",
"version": "1.1.0-rc.3",
"version": "1.1.0-rc.4",
"license": "MIT",

@@ -31,7 +31,7 @@ "exports": {

"dependencies": {
"@radix-ui/react-compose-refs": "1.1.0-rc.3"
"@radix-ui/react-compose-refs": "1.1.0-rc.4"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0"
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0"
},

@@ -38,0 +38,0 @@ "peerDependenciesMeta": {

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