React Native Router (React - Native - Router -flux)——在动作触发中有
React Native Router (react-native-router-flux) - more control in action triggering
我们使用React Native Router来管理导航。我们路由器的渲染函数是这样的:
<Scene key="tabbar" tabs={true} hideNavBar={true} tabBarStyle={{position: 'absolute', top: 0, left: 0}}>
<Scene key={TAB_1} component={Tab1Container} icon={TabIcon} title={TAB_1_TITLE} hideNavBar={true} />
<Scene key={TAB_2} component={Tab2Container} icon={TabIcon} title={TAB_2_TITLE} hideNavBar={true} />
<Scene key={TAB_3} component={Tab3Container} icon={TabIcon} title={TAB_3_TITLE} hideNavBar={true} />
<Scene key={TAB_4} component={Tab4Container} icon={TabIcon} title={TAB_4_TITLE} hideNavBar={true} />
<Scene key={TAB_5} component={Tab5Container} icon={TabIcon} title={TAB_5_TITLE} hideNavBar={true} />
</Scene>
在我们的应用程序中,不允许立即从TAB_1跳到TAB_5。你必须从TAB_2到TAB_5。目前当我可以从开始跳转到结束
现在我找不到任何可能的东西,像一个函数,可以在动作被触发之前触发。
伪代码:
if(current_pressed_tab <= progress_tab){
//head on to next tab
}
else{
//make nothing
}
是否有我可以使用的功能或回调道具?
您需要跟踪您在Redux中导航的路线(我认为),并创建自定义Redux动作创建器,在触发导航之前运行您的检查伪代码
相关文章:
- React Native通过Navigator将用户输入数据传递到选项卡栏IOS中的组件
- 使用Jest测试React Native应用程序
- 是否存在React Native“;WEB代码安全防护”;
- React Native Listview留有余地
- 如何在React Native中绘制图形
- 在iOS和Android上使用React native时,我还能使用本机第三方lirbraries吗
- 使用createContainer将Meteor数据获取到React Native中时出现问题
- React Native当前是否支持访问用户'的通讯簿
- React Native-What'It’在任何地方都要留下逗号
- React Native DeviceEventEmitter键盘WillShow停止工作
- 与React Native的Chart.js等效
- 如何使用webview在React Native中使用Highcharts
- 如何在React Native的MapView中设置标记
- React Native NavigatorIOS
- 如何获得React Native TextInput以在提交后保持焦点
- 使用react native检测应用程序终止
- 可以在React Native中制作一个自哈希应用程序
- React Native AlertOS api中可能有多个文本字段
- react native中常见的js模块
- 在React Native+Redux中使用Navigator