Thesis:
Is there a case to be made for React setting props and state earlier in the component lifecycle?
Do you have this boilerplate in your React class?
var Thing = React.createClass({
...
componentDidMount() {
this.loadUserPosts(this.props);
},
// Detect and react to changes in the userID prop
componentWillReceiveProps(nextProps) {
if (this.props.userID !== nextProps.userID) {
this.loadUserPosts(nextProps);
}
},
// Loads all posts for the current user
loadUserPosts: function(props) {
... load all posts for props.userID
}
...
});
If so, you are not the only one.
…