From efaa3fa9560cbd89b3cbec66badc3184fe0c99a6 Mon Sep 17 00:00:00 2001 From: oasis <12181600+oasis-cloud@users.noreply.github.com> Date: Sat, 12 Oct 2024 18:06:16 +0800 Subject: [PATCH] fix(dialog): remove defaultprops (#2639) --- src/packages/dialog/dialogwrap.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/dialog/dialogwrap.tsx b/src/packages/dialog/dialogwrap.tsx index c9a9a6852e..4486e67a13 100644 --- a/src/packages/dialog/dialogwrap.tsx +++ b/src/packages/dialog/dialogwrap.tsx @@ -5,6 +5,7 @@ import { Content } from './content' import { OverlayProps, defaultOverlayProps } from '@/packages/overlay/overlay' import { ComponentDefaults } from '@/utils/typings' import Overlay from '@/packages/overlay' +import { mergeProps } from '@/utils/merge-props' interface DialogWrapProps extends OverlayProps { visible: boolean @@ -43,7 +44,7 @@ export const DialogWrap: FunctionComponent< onClose, onCancel, onOverlayClick, - } = props + } = mergeProps(defaultDialogProps, props) const onHandleClickOverlay = (e: any) => { if (closeOnOverlayClick && visible && e.target === e.currentTarget) { @@ -77,5 +78,4 @@ export const DialogWrap: FunctionComponent< ) } -DialogWrap.defaultProps = defaultDialogProps DialogWrap.displayName = 'NutDialogWrap'