Created
February 2, 2018 20:33
-
-
Save diegogurgel/4686102f1276091c3e0a4c4b3aaaba35 to your computer and use it in GitHub Desktop.
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 React from 'react' | |
import ReactCSSTransitionGroup from 'react-addons-css-transition-group' | |
class Animated extends React.Component { | |
constructor(){ | |
super() | |
this.state = { | |
} | |
} | |
componentDidMount(){ | |
setTimeout(() => { | |
this.setState({ animate: 'animate' }) | |
}, 2000); | |
} | |
render(){ | |
return( | |
<div> | |
<ReactCSSTransitionGroup | |
transitionName="example" | |
className="animate" | |
component="div" | |
transitionEnterTimeout={20000} | |
transitionLeaveTimeoutTimeout={1000}> | |
<span key={this.state.animate}>{this.state.animate}</span> | |
</ReactCSSTransitionGroup> | |
</div> | |
) | |
} | |
} | |
export default Animated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment