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

rc-resize-observer

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-resize-observer - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

es/util.d.ts

1

es/index.d.ts

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

onResize: ResizeObserverCallback;
setChildNode: (node: RefNode) => void;
destroyObserver(): void;

@@ -33,0 +34,0 @@ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactElement<unknown, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>[] | null;

30

es/index.js

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

var ref_1 = require("rc-util/lib/ref");
var resize_observer_polyfill_1 = __importDefault(require("resize-observer-polyfill"));
var util_1 = require("./util");
var INTERNAL_PREFIX_KEY = 'rc-observer-key'; // Still need to be compatible with React 15, we use class component here

@@ -104,2 +108,6 @@

_this.setChildNode = function (node) {
_this.childNode = node;
};
return _this;

@@ -158,4 +166,2 @@ }

value: function render() {
var _this2 = this;
var children = this.props.children;

@@ -173,20 +179,6 @@ var childNodes = toArray_1.default(children);

if (React.isValidElement(childNode)) {
var _ref = childNode.ref;
if (React.isValidElement(childNode) && util_1.supportRef(childNode)) {
var ref = childNode.ref;
childNodes[0] = React.cloneElement(childNode, {
ref: function ref(node) {
_this2.childNode = node; // Should forward ref
if (!_ref) {
return;
}
var type = _typeof(_ref);
if (type === 'function') {
_ref(node);
} else if (type === 'object') {
_ref.current = node;
}
}
ref: ref_1.composeRef(ref, this.setChildNode)
});

@@ -193,0 +185,0 @@ }

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

onResize: ResizeObserverCallback;
setChildNode: (node: RefNode) => void;
destroyObserver(): void;

@@ -33,0 +34,0 @@ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactElement<unknown, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>[] | null;

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

var ref_1 = require("rc-util/lib/ref");
var resize_observer_polyfill_1 = __importDefault(require("resize-observer-polyfill"));
var util_1 = require("./util");
var INTERNAL_PREFIX_KEY = 'rc-observer-key'; // Still need to be compatible with React 15, we use class component here

@@ -104,2 +108,6 @@

_this.setChildNode = function (node) {
_this.childNode = node;
};
return _this;

@@ -158,4 +166,2 @@ }

value: function render() {
var _this2 = this;
var children = this.props.children;

@@ -173,20 +179,6 @@ var childNodes = toArray_1.default(children);

if (React.isValidElement(childNode)) {
var _ref = childNode.ref;
if (React.isValidElement(childNode) && util_1.supportRef(childNode)) {
var ref = childNode.ref;
childNodes[0] = React.cloneElement(childNode, {
ref: function ref(node) {
_this2.childNode = node; // Should forward ref
if (!_ref) {
return;
}
var type = _typeof(_ref);
if (type === 'function') {
_ref(node);
} else if (type === 'object') {
_ref.current = node;
}
}
ref: ref_1.composeRef(ref, this.setChildNode)
});

@@ -193,0 +185,0 @@ }

{
"name": "rc-resize-observer",
"version": "0.1.2",
"version": "0.1.3",
"description": "Resize observer for React",

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

"classnames": "^2.2.1",
"rc-util": "^4.11.1",
"rc-util": "^4.13.0",
"resize-observer-polyfill": "^1.5.1"

@@ -46,0 +46,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