From dee374ffe3f6e5b5e0cdcea6606b55d9e78afed0 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 11 Oct 2014 00:12:43 +0400 Subject: [PATCH] [fixed] Listen to path changes caused by initial redirect, fixes #360 --- modules/mixins/LocationContext.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/mixins/LocationContext.js b/modules/mixins/LocationContext.js index 3de36afaeb..d563f3520b 100644 --- a/modules/mixins/LocationContext.js +++ b/modules/mixins/LocationContext.js @@ -47,17 +47,13 @@ var LocationContext = { if (location) { PathStore.setup(location); + PathStore.addChangeListener(this.handlePathChange); if (this.updateLocation) this.updateLocation(PathStore.getCurrentPath(), PathStore.getCurrentActionType()); } }, - componentDidMount: function () { - if (this.getLocation()) - PathStore.addChangeListener(this.handlePathChange); - }, - componentWillUnmount: function () { if (this.getLocation()) PathStore.removeChangeListener(this.handlePathChange);