Closed safaribardia closed 3 years ago
Hi, could you confirm which OS are you testing with? iOS or Android?
I'm testing it on iOS 14.0 on the iPhone 11 simulator.
Should probably point out that I am also using expo!
Ok... this is very odd. I copy pasted your code (removed imports which i don't have) and it works. I also ran it in expo with iPhone 11 simulator. Would it be possible to send me your whole project so I can debug? Since I cannot reproduce the error, I won't be able to fix it.. There are more users complaining about this so there must be an bug somewhere.
Please also tell me which version of the library are using. Please make sure you're using the latest 3.0.5. Please confirm that
Yes! I just installed it a few hours ago so it is the latest version. Is it cool if I email it to you just so I'm not posting this on Github? Thank you!
Thanks a bunch for offering to share your project. You can email it to me at torgeadelin@gmail.com I will have a look sometime this week.
No worries! Thanks and I will email!
I had the same problem in my project using Expo, any solution for that?
I do have the same issue on an IPhone 11 on IOS 14 too.any solution yet ?
I downgraded @react-navigation/native to ^5.1.6 and it worked
Hello I'm facing the same issue here! Here is my code: ` import React, {useState} from 'react'; import { Platform, StyleSheet, SafeAreaView, Dimensions } from 'react-native'; import { Ionicons, Feather, FontAwesome5 } from '@expo/vector-icons'; import { NavigationContainer } from '@react-navigation/native'; import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs'; import { createStackNavigator } from '@react-navigation/stack'; import { AppearanceProvider } from 'react-native-appearance'; import { AnimatedTabBarNavigator } from "react-native-animated-nav-tab-bar";
const bottomTab = AnimatedTabBarNavigator();
export default function App() { return (
<NavigationContainer>
<bottomTab.Navigator
initialRouteName="Home"
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
let icon;
if (route.name === 'Home') {
iconName = focused
? icon = <Ionicons name={`${Platform.OS === "ios" ? "ios" : "md"}-home`} size={30} color={color} />
: icon = <Ionicons name={`${Platform.OS === "ios" ? "ios" : "md"}-home`} size={30} color={color} />;
} else if (route.name === 'Search') {
iconName = focused
? icon = <Feather name="search" size={size} color={color} />
: icon = <Feather name="search" size={size} color={color} />;
}
else if (route.name === 'History') {
iconName = focused
? icon = <Ionicons name={`${Platform.OS === "ios" ? "ios" : "md"}-list`} size={30} color={color} />
: icon = <Ionicons name={`${Platform.OS === "ios" ? "ios" : "md"}-list`} size={30} color={color} />;
} else if (route.name === 'More') {
iconName = focused
? icon = <Feather name="more-horizontal" size={size} color={color} />
: icon = <Feather name="more-horizontal" size={size} color={color} />;
}
return icon;
},
})}
tabBarOptions={{
activeTintColor: Theme.COLORS.MAIN,
inactiveTintColor: 'grey',
}}
>
<bottomTab.Screen name="Home" component={TopTabsNavigator} />
<bottomTab.Screen name="Search" component={SearchStackNavigator} />
<bottomTab.Screen name="History" component={collapse} />
<bottomTab.Screen name="More" component={MoreStackNavigator} />
</bottomTab.Navigator>
</NavigationContainer>
); } `
+1
Same issue, downgrading @react-navigation/native didn't solve the problem for me
works at 5.1.6
@TheAlmightyThor make sure to run the bundler with --reset-cache
This issue should now be fixed with the latest react-navigation version ^5.9.0
Hello! I am trying to use this but this is the error I get:
Couldn't register the navigator. Have you wrapped your app with 'NavigationContainer' ?
Here is my code for my TabNavigator:
On my App.js, I am indeed wrapping it:
I know that's not the issue because when I replace
const Tab = AnimatedTabBarNavigator();
withconst Tab = createBottomTabNavigator();
it works just fine. I also tried it using the example provided in the documentation with a really simple navigator and same error.