Skip to content
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