React.js Essentials by 2015

React.js Essentials by 2015

Author:2015
Language: eng
Format: epub
Publisher: Packt Publishing


You can use these arguments to prepare for the DOM update. However, you cannot use this.setState() in the componentWillUpdate() method. If you want to update the component's state in response to its properties change, then do that in the componentWillReceiveProps() method, which will be called by React when the properties change.

To demonstrate when the componentWillUpdate() method is called, we need to log it in the StreamTweet component. Add this code after the shouldComponentUpdate() method:

componentWillUpdate: function (nextProps, nextState) { console.log('[Snapterest] StreamTweet: 6. Running componentWillUpdate()'); },



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.