Answer the question
In order to leave comments, you need to log in
React-navigation lag when switching to another tab. How to fix?
Good afternoon. Given:
"react-native": "0.57.1"
"react-navigation": "^2.17.0"
const navigationOptions = ({ navigation }) => ({
tabBarIcon: (options: TabBarIcon) => {
const { routeName } = navigation.state;
const icon = icons[routeName];
return <Ionicons name={icon} size={25} color={options.tintColor} />;
},
});
const RootNavigation = createBottomTabNavigator(
{
Home: {
screen: HomeScreen,
},
Profile: {
screen: ProfileScreen,
},
Cart: {
screen: CartScreen,
},
Orders: {
screen: OrdersScreen,
},
},
{
navigationOptions,
tabBarOptions: {
activeTintColor: '#025baa',
inactiveTintColor: 'gray',
},
},
);
type Props = {};
export default class App extends Component<Props> {
render() {
return <RootNavigation />;
}
}
Answer the question
In order to leave comments, you need to log in
Issue resolved. The bug appears only on the emulator, on real devices everything works as intended.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question