Skip to content

Instantly share code, notes, and snippets.

@mrcthms
Created April 27, 2018 12:56
Show Gist options
  • Save mrcthms/30f532851c4c24945c47db91c63f71c8 to your computer and use it in GitHub Desktop.
Save mrcthms/30f532851c4c24945c47db91c63f71c8 to your computer and use it in GitHub Desktop.
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