Created
April 27, 2018 12:56
-
-
Save mrcthms/30f532851c4c24945c47db91c63f71c8 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 Animation from 'invision-helios/lib/Animation' | |
class Parent extends React.Component { | |
state = { | |
hovered: false | |
} | |
onHover = () => { | |
this.setState({ hovered: !this.state.hover }) | |
} | |
render() { | |
return ( | |
<div onMouseEnter={this.onHover} onMouseLeave={this.onHover}> | |
<Animation order={this.state.hovered ? 'fade-in-shrink' : 'fade-out-shrink'}> | |
<div>i will be animated</div> | |
</Animation> | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment