Last active
May 30, 2018 09:23
-
-
Save Vladimir-Novick/5a627fb37d5ced485cb536ff6cda4f10 to your computer and use it in GitHub Desktop.
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
Currently almost all of our components implement componentWillMount | |
to trigger some operation in reaction to select page: | |
Example: | |
componentWillMount() { | |
// This method runs when the component is first added to the page | |
let startDateIndex = parseInt(this.props.match.params.startDateIndex) || 0; | |
this.props.requestTaskItems(startDateIndex); | |
} | |
My Solution: | |
componentWillMount() { | |
// Now: This method runs when the component run | |
// Note that the above example is very simple, startDateIndex is unique all time | |
var startDateIndex = new Date().getUTCMilliseconds(); | |
this.props.requestTaskItems(startDateIndex); | |
this.updateDimensions(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment