From a49cf936af7d5add0dc6ae92c3e0851103885969 Mon Sep 17 00:00:00 2001 From: Vitaly Rtishchev Date: Thu, 24 Mar 2022 12:57:30 +0300 Subject: [PATCH] [@mantine/core] Notification: Make onClose handler optional --- .../src/components/Notification/Notification.test.tsx | 1 - src/mantine-core/src/components/Notification/Notification.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mantine-core/src/components/Notification/Notification.test.tsx b/src/mantine-core/src/components/Notification/Notification.test.tsx index 82f658be48b..86a33905869 100644 --- a/src/mantine-core/src/components/Notification/Notification.test.tsx +++ b/src/mantine-core/src/components/Notification/Notification.test.tsx @@ -6,7 +6,6 @@ import { Notification, NotificationProps } from './Notification'; const defaultProps: NotificationProps = { icon: 'test-icon', title: 'test-notification', - onClose: () => {}, closeButtonProps: { title: 'test-close' }, }; diff --git a/src/mantine-core/src/components/Notification/Notification.tsx b/src/mantine-core/src/components/Notification/Notification.tsx index b0bd360411d..57cda38b1da 100644 --- a/src/mantine-core/src/components/Notification/Notification.tsx +++ b/src/mantine-core/src/components/Notification/Notification.tsx @@ -18,7 +18,7 @@ export interface NotificationProps extends DefaultProps, Omit, 'title'> { /** Called when close button is clicked */ - onClose(): void; + onClose?(): void; /** Notification line or icon color */ color?: MantineColor;