Skip to content

Commit b922db0

Browse files
committed
refactor(CToast): rename onDismiss to onClose
1 parent 34475db commit b922db0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/toast/CToast.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export interface CToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title
5050
/**
5151
* Method called before the dissmiss animation has started.
5252
*/
53-
onDismiss?: (index: number | null) => void
53+
onClose?: (index: number | null) => void
5454
}
5555

5656
interface ContextProps extends CToastProps {
@@ -72,7 +72,7 @@ export const CToast = forwardRef<HTMLDivElement, CToastProps>(
7272
index,
7373
key,
7474
visible = false,
75-
onDismiss,
75+
onClose,
7676
...rest
7777
},
7878
ref,
@@ -129,7 +129,7 @@ export const CToast = forwardRef<HTMLDivElement, CToastProps>(
129129
<CSSTransition
130130
in={_visible}
131131
timeout={250}
132-
onExited={() => onDismiss && onDismiss(index ? index : null)}
132+
onExited={() => onClose && onClose(index ? index : null)}
133133
unmountOnExit
134134
>
135135
{(state) => {
@@ -166,7 +166,7 @@ CToast.propTypes = {
166166
delay: PropTypes.number,
167167
index: PropTypes.number,
168168
key: PropTypes.number,
169-
onDismiss: PropTypes.func,
169+
onClose: PropTypes.func,
170170
visible: PropTypes.bool,
171171
}
172172

0 commit comments

Comments
 (0)