Skip to content

Commit

Permalink
fix: toast.show
Browse files Browse the repository at this point in the history
  • Loading branch information
linjinze999 committed Aug 30, 2024
1 parent 0bd58ea commit b8fc66f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/hippy_ui_react/src/components/Toast/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class Toast extends Component<ToastProps, ToastState> {
* @param props toast属性
* */
static show(text: ToastProps['text'] | ToastProps, props?: Partial<ToastProps>) {
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: [
Expand Down

0 comments on commit b8fc66f

Please sign in to comment.