2017-05-08 38 views
0

我使用'react-navigation'中的StackNavigator來控制導航,並使用Meteor來獲取數據。爲了刪除默認導航標題,我寫了這個 static navigationOptions = { header: null};。它適用於靜態數據。但每當我打電話createContainer()函數來收集數據時,該組件會在我的自定義標題上方顯示默認的白色標題。任何人都可以告訴我我錯過了什麼?提前致謝!爲什麼在React-Native顯示堆棧導航器標題中創建容器流星調用?

+0

您可以發佈代碼示例? – Jankapunkt

回答

0

您可以通過將靜態navigationOptions移出課程來使其工作。 例如,您可以保存在變量

const container = createContainer(() => { 
    Meteor.subscribe('somedata') 
    return { 
    data: Meteor.data() 
    } 
}, YourClass) 

創建容器和附加navigationOptions它:

container.navigationOptions = { header: null} 

和出口新容器附有navigationOptions

export default container 
相關問題