From 29e9a8027b7ea8b85b9a9c5663965629c95607f9 Mon Sep 17 00:00:00 2001 From: jungsoo108 Date: Thu, 18 Feb 2016 12:11:26 +0900 Subject: [PATCH 1/2] BaseRouter bug fix - never call this["_"+action](name,props); in route --- BaseRouter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseRouter.js b/BaseRouter.js index 69c07f0a9..63efe36eb 100644 --- a/BaseRouter.js +++ b/BaseRouter.js @@ -163,7 +163,7 @@ export default class BaseRouter { } else { throw new Error("No handler "+handler+" for route="+name); } - if (!this["_"+action]) { + if (this["_"+action]) { this["_" + action](name, props); } return true; From 97ef6b199c2bc3649cbaa2dd63ccb234ea4ba37d Mon Sep 17 00:00:00 2001 From: jungsoo108 Date: Thu, 18 Feb 2016 12:12:28 +0900 Subject: [PATCH 2/2] add data 'route' when dispatch Actions BEFORE_FOCUS, AFTER_FOCUS --- Router.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Router.js b/Router.js index d3820a61b..4dc4dd9df 100644 --- a/Router.js +++ b/Router.js @@ -32,24 +32,28 @@ export default class Router extends React.Component { if (this.props.dispatch) { this.router.delegate.refs.nav.navigationContext.addListener('willfocus', function (ev) { - let name = ev.data.route.name; - let title = ev.data.route.title; + let route = ev.data.route; + let name = route.name; + let title = route.title; this.props.dispatch({ type: Actions.BEFORE_FOCUS, name: name, - title: title + title: title, + route: route }); }.bind(this)); this.router.delegate.refs.nav.navigationContext.addListener('didfocus', function (ev) { - let name = ev.data.route.name; - let title = ev.data.route.title; + let route = ev.data.route; + let name = route.name; + let title = route.title; this.props.dispatch({ type: Actions.AFTER_FOCUS, name: name, - title: title + title: title, + route: route }); }.bind(this)); }