Skip to content

Commit

Permalink
[added] onChange event to Routes
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanflorence committed Oct 6, 2014
1 parent a454e72 commit 5aae2a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/components/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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);
}
});
},
Expand Down

0 comments on commit 5aae2a8

Please sign in to comment.