このコンポーネントのコンストラクタには、最初にPageOne
とPageTwo
の両方を作成してから、レンダリングに関連するものを渡します。以下のような
何か:そうあなただけのアプリを開いたとき、それは2つのページをロード
_initComponent() { //to call on constructor, or right after component mounted, or when props changed. make sure this does only run once in the component lifetime.
this.page1 = <PageOne navigator={navigator}
setIndex={this.setIndex} />
this.page2 = <PageTwo navigator={navigator}
index={this.state.index} />
}
_renderScene(route, navigator) {
if (route.id === 1) {
return this.page1
} else if (route.id === 2) {
return this.page2
}
}
を持っているでしょうか? – Rob