[英]React-Navigation StackNavigator header not showing
I'm trying to get the StackNavigator to work from react-navigation.org 我正在尝试从react-navigation.org使StackNavigator工作
I have another app that I'm successfully using TabNavigator which shows up fine. 我有另一个可以成功使用TabNavigator的应用程序,显示效果很好。
Things I've tried so far to try and get this to work.. 到目前为止,我已经尝试过一些尝试来使它起作用。
Not sure what to try next... 不知道下一步该怎么做...
index.ios.js index.ios.js
import App from './src/App'
/src/App.js /src/App.js
/* @flow */
import {AppRegistry} from 'react-native'
import QuestionList from './questionRow/QuestionList'
import React from 'react'
import {StackNavigator} from 'react-navigation'
export default class App extends React.Component {
static navigationOptions = {
title: 'Questions',
}
state = {}
render() {
return <QuestionList />
}
}
const AIBUApp = StackNavigator({
Home: {screen: App},
})
AppRegistry.registerComponent('aibu', () => App)
Any ideas? 有任何想法吗?
I wasn't doing the correct App Registry. 我没有执行正确的App Registry。
Should have been... 本来应该...
AppRegistry.registerComponent('aibu', () => AIBUApp)
Doesn't matter where you place this, can either be in the App.js or the index.ios/android.js 不管放置在哪里,都可以在App.js或index.ios / android.js中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.