rc-trigger
Advanced tools
Comparing version 5.2.13 to 5.2.14
@@ -46,3 +46,2 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
// ensure `getContainer` will be called only once | ||
function Trigger(props) { | ||
@@ -56,3 +55,2 @@ var _this; | ||
_this.triggerRef = /*#__PURE__*/React.createRef(); | ||
_this.portalContainer = void 0; | ||
_this.attachId = void 0; | ||
@@ -676,4 +674,2 @@ _this.clickOutsideHandler = void 0; | ||
value: function render() { | ||
var _this3 = this; | ||
var popupVisible = this.state.popupVisible; | ||
@@ -753,16 +749,5 @@ var _this$props11 = this.props, | ||
if (popupVisible || this.popupRef.current || forceRender) { | ||
if (!this.portalContainer) { | ||
// In React.StrictMode component will call render multiple time in first mount. | ||
// When you want to refactor with FC, useRef will also init multiple time and | ||
// point to different useRef instance which will create multiple element | ||
// (This multiple render will not trigger effect so you can not clean up this | ||
// in effect). But this is safe with class component since it always point to same class instance. | ||
this.portalContainer = this.getContainer(); | ||
} | ||
portal = /*#__PURE__*/React.createElement(PortalComponent, { | ||
key: "portal", | ||
getContainer: function getContainer() { | ||
return _this3.portalContainer; | ||
}, | ||
getContainer: this.getContainer, | ||
didUpdate: this.handlePortalUpdate | ||
@@ -769,0 +754,0 @@ }, this.getComponent()); |
@@ -76,3 +76,2 @@ "use strict"; | ||
// ensure `getContainer` will be called only once | ||
function Trigger(props) { | ||
@@ -85,3 +84,2 @@ var _this; | ||
_this.triggerRef = /*#__PURE__*/React.createRef(); | ||
_this.portalContainer = void 0; | ||
_this.attachId = void 0; | ||
@@ -707,4 +705,2 @@ _this.clickOutsideHandler = void 0; | ||
value: function render() { | ||
var _this3 = this; | ||
var popupVisible = this.state.popupVisible; | ||
@@ -784,16 +780,5 @@ var _this$props11 = this.props, | ||
if (popupVisible || this.popupRef.current || forceRender) { | ||
if (!this.portalContainer) { | ||
// In React.StrictMode component will call render multiple time in first mount. | ||
// When you want to refactor with FC, useRef will also init multiple time and | ||
// point to different useRef instance which will create multiple element | ||
// (This multiple render will not trigger effect so you can not clean up this | ||
// in effect). But this is safe with class component since it always point to same class instance. | ||
this.portalContainer = this.getContainer(); | ||
} | ||
portal = /*#__PURE__*/React.createElement(PortalComponent, { | ||
key: "portal", | ||
getContainer: function getContainer() { | ||
return _this3.portalContainer; | ||
}, | ||
getContainer: this.getContainer, | ||
didUpdate: this.handlePortalUpdate | ||
@@ -800,0 +785,0 @@ }, this.getComponent()); |
{ | ||
"name": "rc-trigger", | ||
"version": "5.2.13", | ||
"version": "5.2.14", | ||
"description": "base abstract trigger component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |
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
133792
2967