Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit 9e779aa

Browse files
committed
Merge pull request #12 from liouh/master
Check if component is mounted before setting state.
2 parents 2d1fb4b + a55dc08 commit 9e779aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mixinReactProxy.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ module.exports = function(React, desc) {
1616
desc.componentDidMount = function() {
1717
if(!this.state.component) {
1818
this.loadComponent(function(component) {
19-
this.setState({ component: component });
19+
if(this.isMounted()) {
20+
this.setState({ component: component });
21+
}
2022
}.bind(this));
2123
}
2224
};

0 commit comments

Comments
 (0)