Skip to content

Commit

Permalink
fix: fix notification types
Browse files Browse the repository at this point in the history
  • Loading branch information
DaiQiangReal committed Dec 25, 2023
1 parent 71322e8 commit 016e8f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ export type NoticeTheme = 'light' | 'normal';

export interface NoticeProps {
duration?: number;
id?: string | number;
id?: string;
title?: any;
content?: any;
position?: NoticePosition;
type?: NoticeType;
onClick?: (e: any) => void;
onClose?: () => void;
onCloseClick?: (id: string | number) => void;
onCloseClick?: (id: string) => void;
showClose?: boolean;
close?: (id: string | number) => void;
close?: (id: string) => void;
zIndex?: number;
icon?: any;
getPopupContainer?: () => HTMLElement;
Expand Down
4 changes: 2 additions & 2 deletions packages/semi-ui/notification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@ class NotificationList extends BaseComponent<NotificationListProps, Notification

has = (id: string) => this.foundation.has(id);

remove = (id: string | number) => {
remove = (id: string) => {
this.foundation.removeNotice(String(id));
};



update = (id: string|number, opts: NoticeProps)=>{
update = (id: string, opts: NoticeProps)=>{
return this.foundation.update(id, opts);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/semi-ui/notification/notice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Notice extends BaseComponent<NoticeReactProps, NoticeState> {
static contextType = ConfigContext;
static propTypes = {
duration: PropTypes.number,
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
id: PropTypes.string,
title: PropTypes.node,
content: PropTypes.node, // strings、numbers、array、element
type: PropTypes.oneOf(types),
Expand Down

0 comments on commit 016e8f4

Please sign in to comment.