Permalink
Browse files

feat(Appear): Added 'onEntered' and 'onExited' callbacks

  • Loading branch information...
HHogg committed Sep 24, 2018
1 parent 3fc4aef commit 21d4960b1a38bf5558e8261df116e57a298cbb8a
Showing with 16 additions and 1 deletion.
  1. +16 −1 src/Appear/Appear.js
@@ -33,6 +33,10 @@ export default class Appear extends Component {
* Time (in milliseconds) that the appearance/disappearance animation is delayed for.
*/
delay: PropTypes.number,
/** Called back for after appearance */
onEntered: PropTypes.func,
/** Called back for after disappearance */
onExited: PropTypes.func,
/** SKIP */
style: PropTypes.object,
/** One of the global timing speeds, for how long the animations takes to complete */
@@ -49,7 +53,16 @@ export default class Appear extends Component {
};

render() {
const { animation, className, delay, time, visible, ...rest } = this.props;
const {
animation,
className,
delay,
onEntered,
onExited,
time,
visible,
...rest
} = this.props;

const classes = classnames(className, 'Appear', `Appear--${animation}`, `Appear--${time}`, {
[`Appear--${animation}-appear`]: !isClient && visible,
@@ -77,6 +90,8 @@ export default class Appear extends Component {
appear={ isClient && visible }
classNames={ transition }
in={ isClient && visible }
onEntered={ onEntered }
onExited={ onExited }
timeout={ times[time] }>
<Base { ...rest } className={ classes } style={ style } />
</CSSTransition>

0 comments on commit 21d4960

Please sign in to comment.