Last active
August 29, 2015 14:25
-
-
Save daniel-williams/832114edfff779f6aa4f to your computer and use it in GitHub Desktop.
React Component Template
This file contains 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
var _debug = true; | |
var XXXXXX = React.createClass({ | |
displayName: 'XXXXXX', | |
// Mixins | |
mixins: [], | |
// Props | |
propTypes: { | |
}, | |
getDefaultProps: function() { | |
_debug ? console.log('XXXXXX => getDefaultProps | props:', this.props) : null; | |
return { | |
}; | |
}, | |
// State | |
getInitialState: function() { | |
_debug ? console.log('XXXXXX => getInitialState | state:', this.state) : null; | |
return { | |
}; | |
}, | |
// Mount | |
componentWillMount: function() { | |
_debug ? console.log('XXXXXX => componentWillMount | state:', this.state, ', props:', this.props) : null; | |
}, | |
componentDidMount: function() { | |
_debug ? console.log('XXXXXX => componentDidMount | state:', this.state, ', props:', this.props) : null; | |
// React.findDOMNode(this) | |
}, | |
componentWillUnmount: function() { | |
_debug ? console.log('XXXXXX => componentWillUnmount | state:', this.state, ', props:', this.props) : null; | |
}, | |
// Updates | |
componentWillReceiveProps: function(nextProps) { | |
_debug ? console.log('SignIn => componentWillReceiveProps | props:', this.props, ', nextProps:', nextProps) : null; | |
}, | |
//shouldComponentUpdate: function() {}, | |
componentWillUpdate: function() { | |
_debug ? console.log('XXXXXX => componentWillUpdate | state:', this.state, ', props:', this.props) : null; | |
}, | |
componentDidUpdate: function() { | |
_debug ? console.log('XXXXXX => componentDidUpdate | state:', this.state, ', props:', this.props) : null; | |
// DOM stuff here | |
}, | |
// render | |
render: function() { | |
_debug ? console.log('XXXXXX => render | state:', this.state, ', props:', this.props) : null; | |
}, | |
}); | |
module.exports = XXXXXX; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment