@rc-component/trigger
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,2 +0,2 @@ | ||
import { fillRef, useComposeRef } from "rc-util/es/ref"; | ||
import { fillRef, supportRef, useComposeRef } from "rc-util/es/ref"; | ||
import * as React from 'react'; | ||
@@ -6,2 +6,3 @@ var TriggerWrapper = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
getTriggerDOMNode = props.getTriggerDOMNode; | ||
var canUseRef = supportRef(children); | ||
@@ -13,5 +14,5 @@ // When use `getTriggerDOMNode`, we should do additional work to get the real dom | ||
var mergedRef = useComposeRef(setRef, children.ref); | ||
return /*#__PURE__*/React.cloneElement(children, { | ||
return canUseRef ? /*#__PURE__*/React.cloneElement(children, { | ||
ref: mergedRef | ||
}); | ||
}) : children; | ||
}); | ||
@@ -18,0 +19,0 @@ if (process.env.NODE_ENV !== 'production') { |
@@ -13,2 +13,3 @@ "use strict"; | ||
getTriggerDOMNode = props.getTriggerDOMNode; | ||
var canUseRef = (0, _ref.supportRef)(children); | ||
@@ -20,5 +21,5 @@ // When use `getTriggerDOMNode`, we should do additional work to get the real dom | ||
var mergedRef = (0, _ref.useComposeRef)(setRef, children.ref); | ||
return /*#__PURE__*/React.cloneElement(children, { | ||
return canUseRef ? /*#__PURE__*/React.cloneElement(children, { | ||
ref: mergedRef | ||
}); | ||
}) : children; | ||
}); | ||
@@ -25,0 +26,0 @@ if (process.env.NODE_ENV !== 'production') { |
{ | ||
"name": "@rc-component/trigger", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"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
127102
2754