Created
May 23, 2017 13:46
-
-
Save ivancuric/995b1518bd213fd8d1c8cf31f7e304f4 to your computer and use it in GitHub Desktop.
Preact lifecycle methods
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
class Foo extends Component { | |
shouldComponentUpdate(nextProps, nextState) { | |
componentWillReceiveProps(nextProps, nextState) { | |
this.props // previous props | |
this.state // previous state | |
} | |
componentWillMount() { | |
componentDidMount() { | |
componentDidUpdate() { | |
componentWillUnmount() { | |
this.props // current | |
this.state // current | |
} | |
render(props, state) { | |
props===this.props | |
state===this.state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment