react-resize-detector
Advanced tools
Comparing version 4.1.0 to 4.1.1
@@ -90,6 +90,6 @@ "use strict"; | ||
querySelector = _this$props.querySelector, | ||
parentRef = _this$props.parentRef; | ||
targetDomEl = _this$props.targetDomEl; | ||
if ((0, _utils.isSSR)()) return undefined; | ||
if (querySelector) return document.querySelector(querySelector); | ||
if (parentRef && _this.isDOMElement(parentRef)) return parentRef; // eslint-disable-next-line react/no-find-dom-node | ||
if (targetDomEl && _this.isDOMElement(targetDomEl)) return targetDomEl; // eslint-disable-next-line react/no-find-dom-node | ||
@@ -196,2 +196,4 @@ var currentElement = _this.element && (0, _reactDom.findDOMNode)(_this.element); | ||
console.log(renderType); | ||
switch (renderType) { | ||
@@ -211,3 +213,3 @@ case 'renderProp': | ||
return children.map(function (el) { | ||
return (0, _react.cloneElement)(el, childProps); | ||
return !!el && (0, _react.cloneElement)(el, childProps); | ||
}); | ||
@@ -274,3 +276,3 @@ | ||
querySelector: _propTypes.string, | ||
parentRef: (0, _propTypes.oneOfType)([(0, _propTypes.instanceOf)(Element), (0, _propTypes.instanceOf)(HTMLDocument)]), | ||
targetDomEl: (0, _propTypes.oneOfType)([(0, _propTypes.instanceOf)(Element), (0, _propTypes.instanceOf)(HTMLDocument)]), | ||
onResize: _propTypes.func, | ||
@@ -290,3 +292,3 @@ render: _propTypes.func, | ||
querySelector: null, | ||
parentRef: null, | ||
targetDomEl: null, | ||
onResize: null, | ||
@@ -293,0 +295,0 @@ render: undefined, |
@@ -73,6 +73,6 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
querySelector = _this$props.querySelector, | ||
parentRef = _this$props.parentRef; | ||
targetDomEl = _this$props.targetDomEl; | ||
if (isSSR()) return undefined; | ||
if (querySelector) return document.querySelector(querySelector); | ||
if (parentRef && _this.isDOMElement(parentRef)) return parentRef; // eslint-disable-next-line react/no-find-dom-node | ||
if (targetDomEl && _this.isDOMElement(targetDomEl)) return targetDomEl; // eslint-disable-next-line react/no-find-dom-node | ||
@@ -179,2 +179,4 @@ var currentElement = _this.element && findDOMNode(_this.element); | ||
console.log(renderType); | ||
switch (renderType) { | ||
@@ -194,3 +196,3 @@ case 'renderProp': | ||
return children.map(function (el) { | ||
return cloneElement(el, childProps); | ||
return !!el && cloneElement(el, childProps); | ||
}); | ||
@@ -257,3 +259,3 @@ | ||
querySelector: string, | ||
parentRef: oneOfType([instanceOf(Element), instanceOf(HTMLDocument)]), | ||
targetDomEl: oneOfType([instanceOf(Element), instanceOf(HTMLDocument)]), | ||
onResize: func, | ||
@@ -273,3 +275,3 @@ render: func, | ||
querySelector: null, | ||
parentRef: null, | ||
targetDomEl: null, | ||
onResize: null, | ||
@@ -276,0 +278,0 @@ render: undefined, |
@@ -46,3 +46,3 @@ { | ||
"author": "Vitalii Maslianok <maslianok@gmail.com> (https://github.com/maslianok)", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"bugs": { | ||
@@ -49,0 +49,0 @@ "url": "https://github.com/maslianok/react-resize-detector/issues" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
197490
750