Skip to content

Commit 737de0d

Browse files
committed
Merge pull request #54 from litek/master
Update active state when changing props
2 parents c596293 + 8996bcb commit 737de0d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/components/Link.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ var Link = React.createClass({
9898
ActiveStore.removeChangeListener(this.handleActiveChange);
9999
},
100100

101+
componentWillReceiveProps: function(props) {
102+
var params = Link.getUnreservedProps(props);
103+
104+
this.setState({
105+
isActive: ActiveStore.isActive(props.to, params, props.query)
106+
});
107+
},
108+
101109
handleActiveChange: function () {
102110
if (this.isMounted())
103111
this.updateActive();

0 commit comments

Comments
 (0)