@@ -73,6 +73,10 @@ class Router extends React.Component {
7373 this . emitter = new EventEmitter ( ) ;
7474 }
7575
76+ componentWillMount ( ) {
77+ this . state . route = this . props . firstRoute ;
78+ }
79+
7680 componentDidMount ( ) {
7781 this . refs . navigator . navigationContext . addListener ( 'willfocus' , ( event ) => {
7882 const route = event . data . route ;
@@ -96,23 +100,23 @@ class Router extends React.Component {
96100 this . onWillPush ( route ) ;
97101 } ) ;
98102 aspect . after ( this . refs . navigator , 'push' , ( route ) => {
99- // temporary hack to fix bug in aspect library
103+ // temporary hack to fix bug in aspect library
100104 this . onDidPush ( route || arguments [ 1 ] ) ;
101105 } ) ;
102106
103107 aspect . before ( this . refs . navigator , 'resetTo' , ( route ) => {
104108 this . onWillResetTo ( route ) ;
105109 } ) ;
106110 aspect . after ( this . refs . navigator , 'resetTo' , ( route ) => {
107- // temporary hack to fix bug in aspect library
111+ // temporary hack to fix bug in aspect library
108112 this . onDidResetTo ( route || arguments [ 1 ] ) ;
109113 } ) ;
110114
111115 aspect . before ( this . refs . navigator , 'replace' , ( route ) => {
112116 this . onWillReplace ( route ) ;
113117 } ) ;
114118 aspect . after ( this . refs . navigator , 'replace' , ( route ) => {
115- // temporary hack to fix bug in aspect library
119+ // temporary hack to fix bug in aspect library
116120 this . onDidReplace ( route || arguments [ 1 ] ) ;
117121 } ) ;
118122
0 commit comments