diff --git a/src/lib/createContainer.js b/src/lib/createContainer.js index fd977d2..dcc2b28 100644 --- a/src/lib/createContainer.js +++ b/src/lib/createContainer.js @@ -111,7 +111,9 @@ module.exports = function (Component, options) { return; } try { - _this.setState(queryResults); + // See discussion at https://github.com/facebook/react/issues/2787 + if (_this.isMounted()) + _this.setState(queryResults); } catch (error) { // Call to setState may fail if renderToString() was used.