We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4d84f5 commit b030f50Copy full SHA for b030f50
src/NotificationSystem.jsx
@@ -8,6 +8,8 @@ var NotificationSystem = React.createClass({
8
9
uid: 3400,
10
11
+ _isMounted: false,
12
+
13
_getStyles: {
14
overrideStyle: {},
15
@@ -72,7 +74,9 @@ var NotificationSystem = React.createClass({
72
74
notification.onRemove(notification);
73
75
}
76
- this.setState({ notifications: notifications });
77
+ if(this._isMounted) {
78
+ this.setState({ notifications: notifications });
79
+ }
80
},
81
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
177
178
render: function() {
0 commit comments