Skip to content

Commit 848361e

Browse files
James BairdJames Baird
authored andcommitted
[fixed] Clean up mounted route component on unmount so we don't leak references
1 parent 4e954a6 commit 848361e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/RouteHandlerMixin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ var RouteHandlerMixin = {
3030
this._updateRouteComponent();
3131
},
3232

33+
componentWillUnmount: function () {
34+
this.context.setRouteComponentAtDepth(this.getRouteDepth(), null);
35+
},
36+
3337
_updateRouteComponent: function () {
3438
this.context.setRouteComponentAtDepth(this.getRouteDepth(), this.refs[REF_NAME]);
3539
},

0 commit comments

Comments
 (0)