Socket
Socket
Sign inDemoInstall

rc-util

Package Overview
Dependencies
Maintainers
9
Versions
211
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.28.0 to 5.29.0

3

es/Dom/findDOMNode.d.ts
import React from 'react';
export declare function isDOM(node: any): boolean;
/**
* Return if a node is a DOM node. Else will return by `findDOMNode`
*/
export default function findDOMNode<T = Element | Text>(node: React.ReactInstance | HTMLElement): T;
export default function findDOMNode<T = Element | Text>(node: React.ReactInstance | HTMLElement | SVGElement): T;
import React from 'react';
import ReactDOM from 'react-dom';
export function isDOM(node) {
// https://developer.mozilla.org/en-US/docs/Web/API/Element
// Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
return node instanceof HTMLElement || node instanceof SVGElement;
}

@@ -8,3 +13,3 @@ /**

export default function findDOMNode(node) {
if (node instanceof HTMLElement) {
if (isDOM(node)) {
return node;

@@ -11,0 +16,0 @@ }

import React from 'react';
export declare function isDOM(node: any): boolean;
/**
* Return if a node is a DOM node. Else will return by `findDOMNode`
*/
export default function findDOMNode<T = Element | Text>(node: React.ReactInstance | HTMLElement): T;
export default function findDOMNode<T = Element | Text>(node: React.ReactInstance | HTMLElement | SVGElement): T;

@@ -8,4 +8,11 @@ "use strict";

exports.default = findDOMNode;
exports.isDOM = isDOM;
var _react = _interopRequireDefault(require("react"));
var _reactDom = _interopRequireDefault(require("react-dom"));
function isDOM(node) {
// https://developer.mozilla.org/en-US/docs/Web/API/Element
// Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
return node instanceof HTMLElement || node instanceof SVGElement;
}
/**

@@ -15,3 +22,3 @@ * Return if a node is a DOM node. Else will return by `findDOMNode`

function findDOMNode(node) {
if (node instanceof HTMLElement) {
if (isDOM(node)) {
return node;

@@ -18,0 +25,0 @@ }

{
"name": "rc-util",
"version": "5.28.0",
"version": "5.29.0",
"description": "Common Utils For React Component",

@@ -5,0 +5,0 @@ "keywords": [

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