From 33ad329bc4c01065696cc83cc7a6ab02f64e470d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Mon, 9 Dec 2024 11:36:44 +0800 Subject: [PATCH] chore: bump rc-util --- package.json | 2 +- src/TriggerWrapper.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index df5da243..8c954182 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 48d27cf9..0facc9ad 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, {