From b8fc66f4c4a615541385e63a2077cf0f6380252c Mon Sep 17 00:00:00 2001 From: jinzelin Date: Fri, 30 Aug 2024 10:52:28 +0800 Subject: [PATCH] fix: toast.show --- packages/hippy_ui_react/src/components/Toast/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hippy_ui_react/src/components/Toast/index.tsx b/packages/hippy_ui_react/src/components/Toast/index.tsx index 1c9b51e..3d46a06 100644 --- a/packages/hippy_ui_react/src/components/Toast/index.tsx +++ b/packages/hippy_ui_react/src/components/Toast/index.tsx @@ -52,7 +52,8 @@ class Toast extends Component { * @param props toast属性 * */ static show(text: ToastProps['text'] | ToastProps, props?: Partial) { - const _props = typeof text === 'string' ? { text, ...props } : { ...text, ...props }; + const _props = + typeof text === 'string' ? { text, ...(props || {}) } : { ...(text as ToastProps), ...(props || {}) }; Provider.updateGlobalView({ [GLOBAL_VIEW_KEY_TOAST]: { data: [