Unregister the UploadBar event listener on unmount
This commit is contained in:
parent
f51a022be3
commit
544a6593e1
1 changed files with 2 additions and 1 deletions
|
@ -25,12 +25,13 @@ module.exports = React.createClass({displayName: 'UploadBar',
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
dis.register(this.onAction);
|
this.dispatcherRef = dis.register(this.onAction);
|
||||||
this.mounted = true;
|
this.mounted = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
this.mounted = false;
|
this.mounted = false;
|
||||||
|
dis.unregister(this.dispatcherRef);
|
||||||
},
|
},
|
||||||
|
|
||||||
onAction: function(payload) {
|
onAction: function(payload) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue