Skip to content

Commit

Permalink
Merge pull request remix-run#54 from litek/master
Browse files Browse the repository at this point in the history
Update active state when changing props
  • Loading branch information
ryanflorence committed Jun 28, 2014
2 parents c596293 + 8996bcb commit 737de0d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/components/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ var Link = React.createClass({
ActiveStore.removeChangeListener(this.handleActiveChange);
},

componentWillReceiveProps: function(props) {
var params = Link.getUnreservedProps(props);

this.setState({
isActive: ActiveStore.isActive(props.to, params, props.query)
});
},

handleActiveChange: function () {
if (this.isMounted())
this.updateActive();
Expand Down

0 comments on commit 737de0d

Please sign in to comment.