Skip to content

Commit b4a5d05

Browse files
fix(Notification): allow undefined props in TypeScript (#15068)
Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>
1 parent 5da61b5 commit b4a5d05

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/react/src/components/Notification/Notification.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export interface ToastNotificationProps extends HTMLAttributes<HTMLDivElement> {
336336
/**
337337
* Specify what state the notification represents
338338
*/
339-
kind:
339+
kind?:
340340
| 'error'
341341
| 'info'
342342
| 'info-square'
@@ -357,13 +357,13 @@ export interface ToastNotificationProps extends HTMLAttributes<HTMLDivElement> {
357357
/**
358358
* Provide a function that is called when the close button is clicked
359359
*/
360-
onCloseButtonClick(event: MouseEvent): void;
360+
onCloseButtonClick?(event: MouseEvent): void;
361361

362362
/**
363363
* By default, this value is "status". You can also provide an alternate
364364
* role if it makes sense from the accessibility-side
365365
*/
366-
role: 'alert' | 'log' | 'status';
366+
role?: 'alert' | 'log' | 'status';
367367

368368
/**
369369
* Provide a description for "status" icon that can be read by screen readers
@@ -612,7 +612,7 @@ export interface InlineNotificationProps
612612
/**
613613
* Specify what state the notification represents
614614
*/
615-
kind:
615+
kind?:
616616
| 'error'
617617
| 'info'
618618
| 'info-square'
@@ -633,13 +633,13 @@ export interface InlineNotificationProps
633633
/**
634634
* Provide a function that is called when the close button is clicked
635635
*/
636-
onCloseButtonClick(event: MouseEvent): void;
636+
onCloseButtonClick?(event: MouseEvent): void;
637637

638638
/**
639639
* By default, this value is "status". You can also provide an alternate
640640
* role if it makes sense from the accessibility-side.
641641
*/
642-
role: 'alert' | 'log' | 'status';
642+
role?: 'alert' | 'log' | 'status';
643643

644644
/**
645645
* Provide a description for "status" icon that can be read by screen readers
@@ -859,7 +859,7 @@ export interface ActionableNotificationProps
859859
/**
860860
* Specify what state the notification represents
861861
*/
862-
kind:
862+
kind?:
863863
| 'error'
864864
| 'info'
865865
| 'info-square'
@@ -886,7 +886,7 @@ export interface ActionableNotificationProps
886886
/**
887887
* Provide a function that is called when the close button is clicked
888888
*/
889-
onCloseButtonClick(event: MouseEvent): void;
889+
onCloseButtonClick?(event: MouseEvent): void;
890890

891891
/**
892892
* By default, this value is "alertdialog". You can also provide an alternate

0 commit comments

Comments
 (0)