Created
October 4, 2015 16:48
-
-
Save lwhorton/c7781be693642028cd62 to your computer and use it in GitHub Desktop.
React, please let me drive
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
| shouldComponentUpdate: function () { | |
| if (this.state.someState) { | |
| // do stuff | |
| } else { | |
| // do different stuff | |
| } | |
| } | |
| , componentDidMount: function() { | |
| if (this.props.someProp && this.state.someOtherState) { | |
| if (!this.props.anotherProp) { | |
| // more stuff | |
| } else { | |
| // different stuff | |
| } | |
| } | |
| } | |
| , render: function() { | |
| if (this.state.someState) { | |
| // do some stuff | |
| } | |
| if (this.props.someProperty) { | |
| if (this.someOtherState && this.someState) { | |
| // do more stuff | |
| } else { | |
| // do different stuff | |
| } | |
| } else if (this.props.someSecondProperty) { | |
| if (!this.someOtherState) { | |
| // do other different stuff | |
| } | |
| } | |
| ... etc. | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment