diff --git a/package.json b/package.json index df5da24..8c95418 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "classnames": "^2.3.2", "rc-motion": "^2.0.0", "rc-resize-observer": "^1.3.1", - "rc-util": "^5.38.0" + "rc-util": "^5.44.0" }, "peerDependencies": { "react": ">=16.9.0", diff --git a/src/TriggerWrapper.tsx b/src/TriggerWrapper.tsx index 48d27cf..0facc9a 100644 --- a/src/TriggerWrapper.tsx +++ b/src/TriggerWrapper.tsx @@ -1,4 +1,9 @@ -import { fillRef, supportRef, useComposeRef } from 'rc-util/lib/ref'; +import { + fillRef, + getNodeRef, + supportRef, + useComposeRef, +} from 'rc-util/lib/ref'; import * as React from 'react'; import type { TriggerProps } from '.'; @@ -21,7 +26,7 @@ const TriggerWrapper = React.forwardRef( [getTriggerDOMNode], ); - const mergedRef = useComposeRef(setRef, (children as any).ref); + const mergedRef = useComposeRef(setRef, getNodeRef(children)); return canUseRef ? React.cloneElement(children, {