@@ -8,14 +8,22 @@ export interface CTabPaneProps extends HTMLAttributes<HTMLDivElement> {
88 * A string of all className you want applied to the base component.
99 */
1010 className ?: string
11+ /**
12+ * Callback fired when the component requests to be hidden.
13+ */
14+ onHide ?: ( ) => void
15+ /**
16+ * Callback fired when the component requests to be shown.
17+ */
18+ onShow ?: ( ) => void
1119 /**
1220 * Toggle the visibility of component.
1321 */
1422 visible ?: boolean
1523}
1624
1725export const CTabPane = forwardRef < HTMLDivElement , CTabPaneProps > (
18- ( { children, className, visible, ...rest } , ref ) => {
26+ ( { children, className, onHide , onShow , visible, ...rest } , ref ) => {
1927 const style = {
2028 transition : `opacity 150ms linear` ,
2129 }
@@ -32,7 +40,7 @@ export const CTabPane = forwardRef<HTMLDivElement, CTabPaneProps>(
3240
3341 const _className = classNames ( 'tab-pane' , 'fade' , className )
3442 return (
35- < Transition in = { visible } timeout = { 350 } >
43+ < Transition in = { visible } onEnter = { onShow } onExit = { onHide } timeout = { 350 } >
3644 { ( state ) => {
3745 const transitionClass = getTransitionClass ( state )
3846 return (
@@ -54,6 +62,8 @@ export const CTabPane = forwardRef<HTMLDivElement, CTabPaneProps>(
5462CTabPane . propTypes = {
5563 children : PropTypes . node ,
5664 className : PropTypes . string ,
65+ onHide : PropTypes . func ,
66+ onShow : PropTypes . func ,
5767 visible : PropTypes . bool ,
5868}
5969
0 commit comments