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

rc-util

Package Overview
Dependencies
Maintainers
9
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-util - npm Package Compare versions

Comparing version 5.43.0 to 5.43.1

21

es/ref.js
import _typeof from "@babel/runtime/helpers/esm/typeof";
import { isValidElement, version } from 'react';
import { isValidElement } from 'react';
import { ForwardRef, isFragment, isMemo } from 'react-is';

@@ -69,16 +69,11 @@ import useMemo from "./hooks/useMemo";

*/
export var getNodeRef = Number(version.split('.')[0]) >= 19 ?
// >= React 19
function (node) {
if (isReactElement(node)) {
return node.props.ref;
export var getNodeRef = function getNodeRef(node) {
if (node && isReactElement(node)) {
var ele = node;
// Source from:
// https://github.com/mui/material-ui/blob/master/packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts
return ele.props.propertyIsEnumerable('ref') ? ele.props.ref : ele.ref;
}
return null;
} :
// < React 19
function (node) {
if (isReactElement(node)) {
return node.ref;
}
return null;
};

@@ -76,16 +76,11 @@ "use strict";

*/
var getNodeRef = exports.getNodeRef = Number(_react.version.split('.')[0]) >= 19 ?
// >= React 19
function (node) {
if (isReactElement(node)) {
return node.props.ref;
var getNodeRef = exports.getNodeRef = function getNodeRef(node) {
if (node && isReactElement(node)) {
var ele = node;
// Source from:
// https://github.com/mui/material-ui/blob/master/packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts
return ele.props.propertyIsEnumerable('ref') ? ele.props.ref : ele.ref;
}
return null;
} :
// < React 19
function (node) {
if (isReactElement(node)) {
return node.ref;
}
return null;
};
{
"name": "rc-util",
"version": "5.43.0",
"version": "5.43.1",
"description": "Common Utils For React Component",

@@ -30,3 +30,3 @@ "keywords": [

"prepare": "husky install",
"prepublishOnly": "npm run compile && np --yolo --no-publish",
"prepublishOnly": "npm run compile ",
"start": "dumi dev",

@@ -71,2 +71,4 @@ "test": "rc-test"

"react-dom": "^18.0.0",
"react-19": "npm:react@19.0.0-rc-de68d2f4-20241204",
"react-dom-19": "npm:react-dom@19.0.0-rc-de68d2f4-20241204",
"typescript": "^5.3.2"

@@ -73,0 +75,0 @@ },

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