Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Last active March 27, 2018 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeaholicguy/d4aa07c754f25262e59745e7ad1d186c to your computer and use it in GitHub Desktop.
Save codeaholicguy/d4aa07c754f25262e59745e7ad1d186c to your computer and use it in GitHub Desktop.
class IndexPage extends React.Component {
componentDidMount() {
lottie.loadAnimation({
container: this._el,
renderer: 'svg',
animationData: animation,
})
}
render() {
return (
<div>
<p>
<span
style={{
fontWeight: 'bold',
color: 'purple',
cursor: 'pointer',
}}
onClick={this._click}
>
Click me
</span>
{' to see miracle'}
</p>
<div
id="animation"
ref={el => (this._el = el)}
style={{
position: 'absolute',
width: '100%',
height: '100%',
top: 0,
left: 0,
}}
/>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment