setState takes a callback which allows you to ensure this.loadGroupsFromQuery() is called only after this.state is updated.
this.setState({...}, function() {
this.loadGroupsFromQuery();
});
setState takes a callback which allows you to ensure this.loadGroupsFromQuery() is called only after this.state is updated.
this.setState({...}, function() {
this.loadGroupsFromQuery();
});