Last active
April 9, 2018 07:52
-
-
Save dbismut/e0282cd557e40b70bf215980cb1ea702 to your computer and use it in GitHub Desktop.
Part 2 - Setting up addEndListener in CSSTransition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ... */ | |
| 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