Skip to content

Commit

Permalink
fix: toast.show
Browse files Browse the repository at this point in the history
  • Loading branch information
linjinze999 committed Sep 13, 2024
1 parent 7e45e94 commit 1decaab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/hippy_ui_react/src/components/Toast/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ class Toast extends Component<ToastProps, ToastState> {
* */
static show(text: ToastProps['text'] | ToastProps, props?: Partial<ToastProps>) {
const _props =
typeof text === 'string' ? { text, ...(props || {}) } : { ...(text as ToastProps), ...(props || {}) };
typeof text === 'string' || isValidElement(text)
? { text, ...(props || {}) }
: { ...(text as ToastProps), ...(props || {}) };
Provider.updateGlobalView({
[GLOBAL_VIEW_KEY_TOAST]: {
data: [
Expand Down

0 comments on commit 1decaab

Please sign in to comment.