Last active
January 16, 2018 23:46
-
-
Save apzentral/30add246abb06bfa01146fa78be8a216 to your computer and use it in GitHub Desktop.
ReactJS: Skeleton for React component in ES6
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
import React, { Component } from "react"; | |
// Component | |
class ComponentClass extends Component { | |
constructor(props) { | |
super(props); | |
this.state = {}; | |
} | |
// render | |
render() { | |
return <div />; | |
} | |
// Life Cycle - Mounting | |
componentWillMount() {} | |
// render() | |
componentDidMount() {} | |
// Life Cycle - Updating | |
componentWillReceiveProps(nextProps) {} | |
shouldComponentUpdate(nextProps, nextState) { | |
return true; | |
} | |
componentWillUpdate(nextProps, nextState) {} | |
// render() | |
componentDidUpdate(prevProps, prevState) {} | |
// Life Cycle - Unmounting | |
componentWillUnmount() {} | |
} | |
export default ComponentClass; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment