Skip to content

Commit

Permalink
fix(ToastNotification): add deprecation flag for old prop
Browse files Browse the repository at this point in the history
  • Loading branch information
booc0mtaco committed Jan 3, 2025
1 parent 8f75d15 commit 5224c37
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/ToastNotification/ToastNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
};

/**
Expand All @@ -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;

Expand Down

0 comments on commit 5224c37

Please sign in to comment.