Skip to content

Instantly share code, notes, and snippets.

@kexhest
Last active November 30, 2015 09:54
Show Gist options
  • Save kexhest/6280b0b7bc28ec083a42 to your computer and use it in GitHub Desktop.
Save kexhest/6280b0b7bc28ec083a42 to your computer and use it in GitHub Desktop.
Empty boilerplate react component.
/**
* This file is part of the [APPLICATION] application.
*/
import React, { PropTypes, Component } from 'react'
import { findDOMNode } from 'react-dom'
import 'TweenLite'
import 'CSSPlugin'
import 'EasePack'
/**
* This is the ReactComponent component class.
*
* @author [name] <[email]>
*/
export default class ReactComponent extends Component {
/**
* Declare expected property types.
*/
static propTypes = {}
/**
* Set default properties.
*/
static defaultProps = {}
/**
* Create component and set initial state.
*
* @param {object} props
*
* @return void
*/
constructor (props) {
super(props)
this.state = {}
}
/**
* This is called at first render when the parent component is added to the
* DOM it blocks other animations from occuring until callback is called.
*
* @param {function} callback
*
* @return void
*/
componentWillAppear (callback) {
callback()
}
/**
* This is called when the callback within componentWillAppear is called.
*
* @return void
*/
componentDidAppear () {
}
/**
* This is called when the component is added to the TransitionGroup,
* it blocks other animations from occuring until callback is called.
*
* @param {function} callback
*
* @return void
*/
componentWillEnter (callback) {
callback()
}
/**
* This is called when the callback within componentWillEnter is called.
*
* @return void
*/
componentDidEnter () {
}
/**
* This is called when the component is removed from the TransitionGroup,
* it keeps the element in the DOM until the callback is called.
*
* @param {function} callback
*
* @return void
*/
componentWillLeave (callback) {
callback()
}
/**
* This is called when the callback within componentWillLeave is called.
*
* @return void
*/
componentDidLeave () {
}
/**
* This is called when the component is removed from the DOM.
*
* @return void
*/
componentWillUnmount () {
}
/**
* Render react component.
*
* @return {object}
*/
render () {
const {} = this.props
const {} = this.state
return (
<div />
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment