react-navigation-bottom-tab

React native navigation v5 tab press not working

让人想犯罪 __ 提交于 2021-02-18 11:45:11
问题 As seen on the code, tabPress is not called, am i doing it wrong or am i missing something, unfortunately i have not found any code samples for react navigation version 5. <Tab.Navigator labeled={false} barStyle={{backgroundColor: '#ffffff', height: 55}} options={{ tabPress: ({navigation}) => { console.log('nav tab press triggered') } }}> <Tab.Screen name={`DeviceNavigatorTab`} component={DeviceNavigator} options={{ tabBarIcon: ({tintColor}) => <Image source={require('../../images/feather

How to add a line at top of the bottom tab when the current tab is active in react navigation 5

≡放荡痞女 提交于 2021-01-29 10:02:30
问题 I want to add the line at the top of the bottom tabs, how to add this? like this issue https://github.com/react-navigation/react-navigation/issues/8957 React navigation versions: "@react-navigation/bottom-tabs": "^5.9.2", "@react-navigation/native": "^5.7.6", "@react-navigation/stack": "^5.9.3", "react": "16.13.1", "react-native": "0.63.3", 回答1: You can use a custom button like below const CustomTabButton = (props) => ( <TouchableOpacity {...props} style={ props.accessibilityState.selected ?

Navigate to the screen when Tab on BottomTabNavigator is pressed

人走茶凉 提交于 2020-12-26 23:23:26
问题 I would like to navigate to the screen when the particular tab on the BottomTabNavigator is pressed. Normally, when the tab is pressed, it navigates to the configured screen automatically. But I don't want to have that behaviour. I want to hide the bottom tab on that screen and provide back feature in the top bar too. I normally use navigation.navigate('routeName') in ReactNavigationStack screens. But I don't know how/where to write this code in the BottomTabNavigator configuration. For

How to implement drawer navigator in each tab?

大城市里の小女人 提交于 2020-12-15 03:36:54
问题 I want to have drawer navigation in each tab and I followed this approach, but it doesn't work when I switch back to the previous tab (maybe some navigation tree issue). As you can see above, the drawer works fine for the first time in each tab, but when I go back to any already navigated tab and try to open the drawer, the drawer doesn't open for that tab but opens up for the just previous tab. I think there's some navigation issue. HomeBottomTab.js Here, I created a Bottom Tab Navigator and

react-native createBottomTabNavigator shows weird tab bar on Android

烈酒焚心 提交于 2020-08-09 09:20:11
问题 I am using react-navigation createBottomTabNavigator to create a bottom tabs navigation. The tab bar appears fine on iOS but on Android, it appears as below: I am not sure what is causing to have this weird styling. Below is my code to create the bottom tab bar: <Provider store={store}> <NavigationContainer theme={GlobalConfig.theme}> <Tab.Navigator screenOptions={({route}) => ({ tabBarIcon: ({focused, color, size}) => { let iconSrc if (route.name === 'Alarms') { iconSrc = require('../img/ic

react-native createBottomTabNavigator shows weird tab bar on Android

允我心安 提交于 2020-08-09 09:20:01
问题 I am using react-navigation createBottomTabNavigator to create a bottom tabs navigation. The tab bar appears fine on iOS but on Android, it appears as below: I am not sure what is causing to have this weird styling. Below is my code to create the bottom tab bar: <Provider store={store}> <NavigationContainer theme={GlobalConfig.theme}> <Tab.Navigator screenOptions={({route}) => ({ tabBarIcon: ({focused, color, size}) => { let iconSrc if (route.name === 'Alarms') { iconSrc = require('../img/ic

Error: undefined Unable to resolve module `@react-navigation/bottom-tabs`

一笑奈何 提交于 2020-07-23 07:39:04
问题 Been searching for a solution about the error module on navigation. I've tried reset-cache, deleting nodu_modules, reinstall the module but still its not working. Full details of the error Unable to resolve module `@react-navigation/native` from `src/App.js`: @react-navigation/native could not be found within the project. Package.json "@react-native-community/masked-view": "^0.1.9", "native-base": "^2.13.12", "react": "16.9.0", "react-native": "0.61.5", "react-native-gesture-handler": "^1.6.1

Error: undefined Unable to resolve module `@react-navigation/bottom-tabs`

女生的网名这么多〃 提交于 2020-07-23 07:38:07
问题 Been searching for a solution about the error module on navigation. I've tried reset-cache, deleting nodu_modules, reinstall the module but still its not working. Full details of the error Unable to resolve module `@react-navigation/native` from `src/App.js`: @react-navigation/native could not be found within the project. Package.json "@react-native-community/masked-view": "^0.1.9", "native-base": "^2.13.12", "react": "16.9.0", "react-native": "0.61.5", "react-native-gesture-handler": "^1.6.1

Error: undefined Unable to resolve module `@react-navigation/bottom-tabs`

倾然丶 夕夏残阳落幕 提交于 2020-07-23 07:37:14
问题 Been searching for a solution about the error module on navigation. I've tried reset-cache, deleting nodu_modules, reinstall the module but still its not working. Full details of the error Unable to resolve module `@react-navigation/native` from `src/App.js`: @react-navigation/native could not be found within the project. Package.json "@react-native-community/masked-view": "^0.1.9", "native-base": "^2.13.12", "react": "16.9.0", "react-native": "0.61.5", "react-native-gesture-handler": "^1.6.1