Skip to content

Commit faa1d3a

Browse files
committed
Merge branch 'GuyAglionby-master' into develop
2 parents 3993fb8 + 1d64e26 commit faa1d3a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/NotificationSystem.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ var NotificationSystem = React.createClass({
88

99
uid: 3400,
1010

11+
_isMounted: false,
12+
1113
_getStyles: {
1214
overrideStyle: {},
1315

@@ -72,7 +74,9 @@ var NotificationSystem = React.createClass({
7274
notification.onRemove(notification);
7375
}
7476

75-
this.setState({ notifications: notifications });
77+
if (this._isMounted) {
78+
this.setState({ notifications: notifications });
79+
}
7680
},
7781

7882
getInitialState: function() {
@@ -164,6 +168,11 @@ var NotificationSystem = React.createClass({
164168

165169
componentDidMount: function() {
166170
this._getStyles.setOverrideStyle(this.props.style);
171+
this._isMounted = true;
172+
},
173+
174+
componentWillUnmount: function() {
175+
this._isMounted = false;
167176
},
168177

169178
render: function() {

0 commit comments

Comments
 (0)