Skip to content

Instantly share code, notes, and snippets.

@JoeTheDave
Created June 29, 2016 16:33
Show Gist options
  • Save JoeTheDave/b82cbe1e7c44b363bd221705db61ddd0 to your computer and use it in GitHub Desktop.
Save JoeTheDave/b82cbe1e7c44b363bd221705db61ddd0 to your computer and use it in GitHub Desktop.
import React from 'react';
import {findDOMNode} from 'React-dom';
class ExampleComponent extends React.Component{
constructor (props) {
super(props);
}
componentWillReceiveProps(nextProps) {
if (nextProps.visible !== this.props.visible) {
if (nextProps.visible) {
$(findDOMNode(this)).stop( true, true ).fadeIn('slow');
} else {
$(findDOMNode(this)).stop( true, true ).fadeOut('slow');
}
}
}
render() {
return (
<div className="example-component"></div>
);
}
}
export default ExampleComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment