react-native - 如何在navigation v5 createbottomtabNavigator中禁用tabBarBadge?

标签 react-native react-navigation-v5 react-navigation-bottom-tab

为了显示通知徽章,我发现可以使用 react 导航中的 tabBarBadge。 tabBarBadge 仅接受数字或字符串,而不接受函数,因此当用户专注于通知屏幕时,我无法找到禁用它的方法。我怎样才能禁用它?

enter image description here

enter image description here

在 tabBarIcon 中,有 tabInfo.focused 让我们知道用户何时在此屏幕上。 tabBarBadge有类似的方法吗?

最佳答案

当用户专注于通知屏幕时设置 tabBarBadge: null

关于react-native - 如何在navigation v5 createbottomtabNavigator中禁用tabBarBadge?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63334202/

相关文章:

react-native - 如何在 React Native 中将键盘颜色更改为 android 的深色模式?

javascript - requireNativeComponent : "RNSScreenStackHeaderConfig" was not found in the UIManager when running android app

ios - React Native iOS 从应用程序文档文件夹中读取图像

react-native - 关闭嵌套的堆栈导航器

react-native - 在 React Native 中隐藏 createBottomTabNavigator 标签栏

ios - React Native 限制?

react-native - 从 React Navigation 更改事件边框颜色 - MaterialTopTabNavigator

reactjs - 如何使用 React Navigation 5 在 Action Creator 中导航到屏幕

react-native - DrawerNavigator 在点击每个选项时始终显示标签栏