这是我的路由器层次结构:
<Tabs
key='tabbar'
backToInitial
onTabOnPress={() => {
console.log('Back to initial and also print this');
}}
swipeEnabled
hideNavBar={true}
>
<Scene
title='Profilo'
key='profile'
component={Profile}
tabBarLabel='Profilo'
icon={TabBarIcon}
name='ios-person'
titleStyle={{
fontFamily: 'RobotoRegular',fontSize: 24,color: '#00b0ff'
}}
>
<Scene
title='adsf'
key='vehicle'
component={Vehicle}
titleStyle={{
fontFamily: 'RobotoRegular',color: '#00b0ff'
}}
/>
</Scene>
</Tabs>
如果我在Profilo
页面上,而我不想转到Vehicle
页面,则使用actions.vehicle()
,但会收到此错误:
actions.vehicle()不是函数
我已经尝试使用this solution,但这也不起作用 我该如何解决这个问题?
受约束的snack
的结果如下: