From 5aae2a8514821fc9acd41e932bb3261b011365a6 Mon Sep 17 00:00:00 2001 From: Ryan Florence Date: Mon, 6 Oct 2014 11:08:07 -0600 Subject: [PATCH] [added] onChange event to Routes --- modules/components/Routes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/components/Routes.js b/modules/components/Routes.js index 8013e0c98a..db6df0b4b2 100644 --- a/modules/components/Routes.js +++ b/modules/components/Routes.js @@ -312,7 +312,8 @@ var Routes = React.createClass({ mixins: [ ActiveContext, LocationContext, RouteContext, ScrollContext ], propTypes: { - initialPath: React.PropTypes.string + initialPath: React.PropTypes.string, + onChange: React.PropTypes.func }, getInitialState: function () { @@ -352,6 +353,7 @@ var Routes = React.createClass({ TransitionHandling.handleAbortedTransition(self, transition); } else { self.updateScroll(path, actionType); + if (self.props.onChange) self.props.onChange.call(self); } }); },