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); } }); },