Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Clears Actions.currentRouter when unmounting ExRouter if this is the …
…current router's ExRouter instance. Fixes #172
  • Loading branch information
danielweinmann committed Feb 4, 2016
commit 8943828d90bd5ccee2bb4ed5f0db9017d1077e40
6 changes: 6 additions & 0 deletions ExRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down