javascript - 反应原生:有办法修复反应选项卡导航 5 中的错误“动画事件必须有事件数据”吗?
问题描述
每次移动选项卡时,我都会收到“动画事件必须有事件数据”错误,我真的不明白是什么原因造成的,为什么。我很乐意在这方面得到一些帮助。我创建了 3 个选项卡,每次在它们之间移动时都会出现此错误。我不知道如何解决它。这个错误的原因是什么?为什么会在我的情况下发生?
import React, { useState } from 'react';
import { Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { useRoute, useNavigation } from '@react-navigation/native';
function NetuneyDigum() {
return (
<>
<View
style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#cbced4',
}}
>
<Text>NetuneyDigum!</Text>
</View>
</>
);
}
function BdikotSadea() {
return (
<View
style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#cbced4',
}}
>
<Text>BdikotSadea!</Text>
</View>
);
}
function E_BitsuaDigdum() {
return (
<View
style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#cbced4',
}}
>
<Text>E_BitsuaDigdum!</Text>
</View>
);
}
const Tab = createMaterialTopTabNavigator();
export default function Screen8() {
const navigation = useNavigation();
const route = useRoute();
const params = route.params;
const { item } = params;
console.log('screen 8: ', params);
return (
<Tab.Navigator
tabBarOptions={{
activeTintColor: '#275d9f',
inactiveTintColor: 'gray',
indicatorStyle: {
backgroundColor: 'red',
},
style: {
// backgroundColor: '#8bb8ef',
},
labelStyle: {
fontSize: 18,
fontWeight: 'bold',
},
}}
>
<Tab.Screen name="one" component={NetuneyDigum} />
<Tab.Screen name="two" component={BdikotSadea} />
<Tab.Screen name="three" component={E_BitsuaDigdum} />
</Tab.Navigator>
);
}
解决方案
推荐阅读
- python - 如何在谷歌课堂 API 中导入 json 文件
- matlab - 分支覆盖是否意味着条件覆盖?
- python - Matplotlib 图例未在绘图方法中显示
- python - select an option using selenium with python
- javascript - Twilio 聊天 - 未读消息计数
- c# - 为什么运行 Visual Studio 项目时文本质量会变差?
- ssis - 如何在使用 SSIS 加载数据之前更改文件名
- visual-studio - 删除 Visual Studio 中所有禁用的断点
- javascript - 过渡导致文本和按钮隐藏在图像后面
- python - 如何在立交桥查询中连接字符串