From 8943828d90bd5ccee2bb4ed5f0db9017d1077e40 Mon Sep 17 00:00:00 2001 From: Daniel Weinmann Date: Thu, 4 Feb 2016 12:52:00 -0200 Subject: [PATCH] Clears Actions.currentRouter when unmounting ExRouter if this is the current router's ExRouter instance. Fixes #172 --- ExRouter.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ExRouter.js b/ExRouter.js index ceb747992..ee7a868f3 100644 --- a/ExRouter.js +++ b/ExRouter.js @@ -187,6 +187,12 @@ export default class ExRouter extends React.Component { this.state = {}; } + componentWillUnmount() { + if (this === Actions.currentRouter.delegate) { + Actions.currentRouter = null; + } + } + onPush(route: Route, props:{ [key: string]: any}):boolean { if (this.props.onPush){ const res = this.props.onPush(route, props);