Skip to content

Commit 5aae2a8

Browse files
committed
[added] onChange event to Routes
1 parent a454e72 commit 5aae2a8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/components/Routes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ var Routes = React.createClass({
312312
mixins: [ ActiveContext, LocationContext, RouteContext, ScrollContext ],
313313

314314
propTypes: {
315-
initialPath: React.PropTypes.string
315+
initialPath: React.PropTypes.string,
316+
onChange: React.PropTypes.func
316317
},
317318

318319
getInitialState: function () {
@@ -352,6 +353,7 @@ var Routes = React.createClass({
352353
TransitionHandling.handleAbortedTransition(self, transition);
353354
} else {
354355
self.updateScroll(path, actionType);
356+
if (self.props.onChange) self.props.onChange.call(self);
355357
}
356358
});
357359
},

0 commit comments

Comments
 (0)