The call to setState in the onload-handler should be guarded by isMounted. My app was adding some images and removing them due to ajax-updates before the image could be loaded. Thus the call inside onload was trying to set the state of an unmounted component.
img.onload = function() {
if(self.isMounted()) {
self.setState({loaded: true})
}
}