Skip to content

Commit 6af24bd

Browse files
committed
[changed] Give ActiveState a chance to update state before mounting
1 parent 517e460 commit 6af24bd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/mixins/ActiveState.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ var ActiveState = {
4545
return this.context.activeDelegate;
4646
},
4747

48+
componentWillMount: function () {
49+
if (this.updateActiveState)
50+
this.updateActiveState();
51+
},
52+
4853
componentDidMount: function () {
4954
this.getActiveDelegate().addChangeListener(this.handleActiveStateChange);
5055
this.handleActiveStateChange();
@@ -55,7 +60,7 @@ var ActiveState = {
5560
},
5661

5762
handleActiveStateChange: function () {
58-
if (this.isMounted() && typeof this.updateActiveState === 'function')
63+
if (this.isMounted() && this.updateActiveState)
5964
this.updateActiveState();
6065
},
6166

0 commit comments

Comments
 (0)