From 5224c376fb61dea05acdb501d5872814bae7c7b5 Mon Sep 17 00:00:00 2001 From: Andrew Holloway Date: Fri, 3 Jan 2025 11:43:23 -0600 Subject: [PATCH] fix(ToastNotification): add deprecation flag for old prop --- src/components/ToastNotification/ToastNotification.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ToastNotification/ToastNotification.tsx b/src/components/ToastNotification/ToastNotification.tsx index 274199375..bc68a1f0f 100644 --- a/src/components/ToastNotification/ToastNotification.tsx +++ b/src/components/ToastNotification/ToastNotification.tsx @@ -32,7 +32,6 @@ export type ToastNotificationProps = { * **Default is `"manual"`**. */ dismissType?: 'manual' | 'auto'; - dissmissType?: 'manual' | 'auto'; // TODO(next-major): remove this misspelled prop at next major release /** * Keyword to characterize the state of the notification */ @@ -41,6 +40,8 @@ export type ToastNotificationProps = { * The title/heading of the notification */ title: string; + /** @deprecated Please use `dismissType` instead */ + dissmissType?: 'manual' | 'auto'; // TODO(next-major): remove this misspelled prop at next major release }; /** @@ -64,7 +65,7 @@ export const ToastNotification = ({ className, ); - // if both are defined, temporarily prefer the original (misspelled) prop for now, but throw a warning + // if both are defined, temporarily prefer the original value of dissmissType to avoid accidental overrides const tempDismissType = dissmissType && dismissType ? dissmissType : dismissType;