Skip to content

Commit

Permalink
clean a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
fkhadra committed Nov 1, 2022
1 parent 80fab3c commit f33823d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Toast.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactNode } from 'react';
import React, { cloneElement, isValidElement, ReactNode } from 'react';
import cx from 'clsx';

import { ProgressBar } from './ProgressBar';
Expand Down Expand Up @@ -66,8 +66,8 @@ export const Toast: React.FC<ToastProps> = props => {
// hide
} else if (isFn(closeButton)) {
Close = closeButton(closeButtonProps);
} else if (React.isValidElement(closeButton)) {
Close = React.cloneElement(closeButton, closeButtonProps);
} else if (isValidElement(closeButton)) {
Close = cloneElement(closeButton, closeButtonProps);
} else {
Close = CloseButton(closeButtonProps);
}
Expand Down

0 comments on commit f33823d

Please sign in to comment.