File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ const CAlert = props => {
1212 //
1313 onShowChange,
1414 closeButton,
15- transition,
1615 color,
1716 fade,
1817 show,
@@ -30,11 +29,11 @@ const CAlert = props => {
3029 )
3130
3231 const alertTransition = {
33- ...CFade . defaultProps ,
34- ...transition ,
35- baseClass : fade ? transition . baseClass : '' ,
36- timeout : fade ? transition . timeout : 0
32+ baseClass : fade ? CFade . baseClass : '' ,
33+ timeout : fade ? CFade . timeout : 0 ,
34+ unmountOnExit : true
3735 }
36+
3837 const [ isOpen , setIsOpen ] = useState ( show )
3938
4039 useEffect ( ( ) => {
@@ -63,10 +62,8 @@ const CAlert = props => {
6362 role = "alert"
6463 { ...attributes }
6564 >
66- { children }
67- { closeButton && < CButtonClose
68- onClick = { ( ) => setIsOpen ( false ) }
69- /> }
65+ { children }
66+ { closeButton && < CButtonClose onClick = { ( ) => setIsOpen ( false ) } /> }
7067 </ CFade >
7168 )
7269}
@@ -81,18 +78,13 @@ CAlert.propTypes = {
8178 color : PropTypes . string ,
8279 fade : PropTypes . bool ,
8380 show : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . number ] ) ,
84- transition : PropTypes . shape ( CFade . propTypes ) ,
8581} ;
8682
8783CAlert . defaultProps = {
8884 tag : 'div' ,
8985 //
9086 show : true ,
91- fade : true ,
92- transition : {
93- ...CFade . defaultProps ,
94- unmountOnExit : true ,
95- }
96- }
97- //export
87+ fade : true
88+ } ;
89+
9890export default CAlert
You can’t perform that action at this time.
0 commit comments