Skip to content

Instantly share code, notes, and snippets.

@dbismut
Last active April 9, 2018 07:52
Show Gist options
  • Select an option

  • Save dbismut/e0282cd557e40b70bf215980cb1ea702 to your computer and use it in GitHub Desktop.

Select an option

Save dbismut/e0282cd557e40b70bf215980cb1ea702 to your computer and use it in GitHub Desktop.
Part 2 - Setting up addEndListener in CSSTransition
/* ... */
import { chain, composite, delay, spring, styler, tween } from 'popmotion';
import { cubicBezier } from 'popmotion/easing';
import scroll from 'stylefire/scroll';
/* ... */
class Post extends PureComponent {
from = {};
to = {};
componentDidMount() {
this.postStyler = styler(this.post);
this.postScroll = scroll(this.post);
}
getPreviewStyleAndPosition = () => {};
onEnter = () => {}
onAddEndListener = (node, done) => {
done();
};
render() {
/* ... */
<CSSTransition
{...transitionProps}
onEnter={this.onEnter}
addEndListener={this.onAddEndListener}
classNames="post"
>
<div className="page full-width page-post">
<div ref={post => (this.post = post)} className="post full-width">
/* ... */
</div>
</div>
</CSSTransition>
}
}
/* ... */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment