File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ var NotificationSystem = React.createClass({
8
8
9
9
uid : 3400 ,
10
10
11
+ _isMounted : false ,
12
+
11
13
_getStyles : {
12
14
overrideStyle : { } ,
13
15
@@ -72,7 +74,9 @@ var NotificationSystem = React.createClass({
72
74
notification . onRemove ( notification ) ;
73
75
}
74
76
75
- this . setState ( { notifications : notifications } ) ;
77
+ if ( this . _isMounted ) {
78
+ this . setState ( { notifications : notifications } ) ;
79
+ }
76
80
} ,
77
81
78
82
getInitialState : function ( ) {
@@ -164,6 +168,11 @@ var NotificationSystem = React.createClass({
164
168
165
169
componentDidMount : function ( ) {
166
170
this . _getStyles . setOverrideStyle ( this . props . style ) ;
171
+ this . _isMounted = true ;
172
+ } ,
173
+
174
+ componentWillUnmount : function ( ) {
175
+ this . _isMounted = false ;
167
176
} ,
168
177
169
178
render : function ( ) {
You can’t perform that action at this time.
0 commit comments