Created
June 29, 2016 16:33
-
-
Save JoeTheDave/b82cbe1e7c44b363bd221705db61ddd0 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 {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