Skip to content

Commit

Permalink
[fixed] Clean up mounted route component on unmount so we don't leak …
Browse files Browse the repository at this point in the history
…references
  • Loading branch information
James Baird authored and James Baird committed Feb 6, 2015
1 parent 4e954a6 commit 848361e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/RouteHandlerMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ var RouteHandlerMixin = {
this._updateRouteComponent();
},

componentWillUnmount: function () {
this.context.setRouteComponentAtDepth(this.getRouteDepth(), null);
},

_updateRouteComponent: function () {
this.context.setRouteComponentAtDepth(this.getRouteDepth(), this.refs[REF_NAME]);
},
Expand Down

0 comments on commit 848361e

Please sign in to comment.