Skip to content

Instantly share code, notes, and snippets.

@gurel
Created August 29, 2015 01:10
Show Gist options
  • Save gurel/38439e71b86b663cda38 to your computer and use it in GitHub Desktop.
Save gurel/38439e71b86b663cda38 to your computer and use it in GitHub Desktop.
import React from "react"
// ReadMe:
// React Lifecycle => https://facebook.github.io/react/docs/component-specs.html
// ES6 Transform => http://babeljs.io/blog/2015/06/07/react-on-es6-plus/
export default class ${NAME} extends React.Component {
displayName: "${NAME}"
static propTypes = {
// ...
}
state = {
// ...
}
static defaultProps = {
// ..
}
constructor(props) {
super(props);
// Operations usually carried out in componentWillMount go here
}
componentDidMount(){ }
componentWillReceiveProps(/*object*/ nextProps){ }
shouldComponentUpdate(/*object*/ nextProps, /*object*/ nextState){
// return Boolean
}
componentWillUpdate(/*object*/ nextProps, /*object*/ nextState){ }
componentDidUpdate(/*object*/ prevProps, /*object*/ prevState){ }
componentWillUnmount(){
}
render(){
var {
className,
...others,
} = this.props;
return (
<div className={className} {...others} >
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment