@@ -73,6 +73,10 @@ class Router extends React.Component {
73
73
this . emitter = new EventEmitter ( ) ;
74
74
}
75
75
76
+ componentWillMount ( ) {
77
+ this . state . route = this . props . firstRoute ;
78
+ }
79
+
76
80
componentDidMount ( ) {
77
81
this . refs . navigator . navigationContext . addListener ( 'willfocus' , ( event ) => {
78
82
const route = event . data . route ;
@@ -96,23 +100,23 @@ class Router extends React.Component {
96
100
this . onWillPush ( route ) ;
97
101
} ) ;
98
102
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
100
104
this . onDidPush ( route || arguments [ 1 ] ) ;
101
105
} ) ;
102
106
103
107
aspect . before ( this . refs . navigator , 'resetTo' , ( route ) => {
104
108
this . onWillResetTo ( route ) ;
105
109
} ) ;
106
110
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
108
112
this . onDidResetTo ( route || arguments [ 1 ] ) ;
109
113
} ) ;
110
114
111
115
aspect . before ( this . refs . navigator , 'replace' , ( route ) => {
112
116
this . onWillReplace ( route ) ;
113
117
} ) ;
114
118
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
116
120
this . onDidReplace ( route || arguments [ 1 ] ) ;
117
121
} ) ;
118
122
0 commit comments