Skip to content

Commit

Permalink
Merge pull request remix-run#783 from severian/cleanup-mount
Browse files Browse the repository at this point in the history
[fixed] Clean up mounted route component on unmount so we don't leak references
  • Loading branch information
ryanflorence committed Feb 10, 2015
2 parents 6bfc79e + 848361e commit edf684c
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 edf684c

Please sign in to comment.