Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add onDisappar method #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/animate-components/containers/Disappear.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ export default class Disappear extends PureComponent {
name: fadeIn,
duration: '2s',
as: 'div',
timingFunction: 'ease'
timingFunction: 'ease',
onDisappear: () => {}
};

static propTypes = {
name: PropTypes.string,
duration: PropTypes.string,
as: PropTypes.string,
timingFunction: PropTypes.string,
component: PropTypes.func
component: PropTypes.func,
onDisappear: PropTypes.func
};

componentWillMount = () => {
Expand All @@ -43,6 +45,7 @@ export default class Disappear extends PureComponent {
'visibility: \'hidden\'; opacity: 0; transition: visibility 0s 2s, opacity 2s linear;';
this.timeouts = setTimeout(() => {
element.remove();
props.onDisappear();
}, 2000); // Sync with fadeOut
});
};
Expand Down