We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e871e4c + 5f5738b commit aaec0bfCopy full SHA for aaec0bf
index.js
@@ -56,6 +56,19 @@ class Router extends React.Component {
56
this.emitter = new EventEmitter();
57
}
58
59
+ componentDidMount() {
60
+ this.refs.navigator.navigationContext.addListener('willfocus', (event) => {
61
+ const route = event.data.route;
62
+ this.setState({ route });
63
+ this.emitter.emit('willFocus', route.name);
64
+ });
65
+
66
+ this.refs.navigator.navigationContext.addListener('didfocus', (event) => {
67
68
+ this.emitter.emit('didFocus', route.name);
69
70
+ }
71
72
onWillFocus(route) {
73
this.setState({ route });
74
this.emitter.emit('willFocus', route.name);
@@ -228,8 +241,6 @@ class Router extends React.Component {
228
241
initialRoute={this.props.firstRoute}
229
242
navigationBar={navigationBar}
230
243
renderScene={this.renderScene}
231
- onDidFocus={this.onDidFocus}
232
- onWillFocus={this.onWillFocus}
233
244
configureScene={this.configureScene}
234
245
/>
235
246
);
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments