File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/components/alert/src Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
1515 /** Defines if the alert is open */
1616 open ?: boolean ;
1717 /** Close handler */
18- onClose ?: ( ) => void ;
18+ onDismiss ?: ( ) => void ;
1919}
2020
2121/**
@@ -29,7 +29,7 @@ export const Alert = ({
2929 skin = "neutral" ,
3030 dismissable,
3131 open = true ,
32- onClose ,
32+ onDismiss ,
3333 children,
3434 className,
3535 ...otherProps
@@ -41,10 +41,10 @@ export const Alert = ({
4141 } , [ open ] ) ;
4242
4343 useEffect ( ( ) => {
44- if ( computedOpen === open || ! onClose ) return ;
44+ if ( computedOpen === open || ! onDismiss ) return ;
4545
46- if ( ! computedOpen ) onClose ( ) ;
47- } , [ computedOpen , onClose , open ] ) ;
46+ if ( ! computedOpen ) onDismiss ( ) ;
47+ } , [ computedOpen , onDismiss , open ] ) ;
4848
4949 return computedOpen ? (
5050 < div { ...otherProps } className = { classNames ( styles . root , styles [ skin ] , className ) } >
You can’t perform that action at this time.
0 commit comments