i'm studying react-native by cloning instagram.
There is any way apply transitionConfig to createBottomTabNavigator(react-navigation)? I know there is no transitionConfig in document. but i want to slide up the page just like instagram's upload
const Footer = createBottomTabNavigator(
{
Home: { screen: Home },
Upload: { screen: Upload },
},
{
initialRouteName: 'Home',
transitionConfig: TransitionConfiguration,
}
);
Add icons to the tab bar To add icons to each tab, first import the Icon component from react-native-vector-icons library inside the navigation/TabNavigator/index. js file. For this example, let's use AntDesign based icons. // after other import statements import Icon from 'react-native-vector-icons/AntDesign';
createBottomTabNavigator do not have transitionConfig. To enable transition when clicking on the nav bar, I made the following workaround.
First put the Upload screen into a StackNavigator, and set tabBarOnPress as follow:
const UploadStack = createStackNavigator({
Upload: Upload
});
UploadStack.navigationOptions = {
tabBarOnPress: ({navigation, defaultHandler}) => { navigation.navigate('ModalUpload') }
}
Then put this stack in the BottomTabNavigator
const Footer = createBottomTabNavigator({
Home: Home,
UploadStack: UploadStack
});
Finally put the BottomTabNavigator and the Upload screen into a StackNavigator with the transitionConfig:
export default createStackNavigator({
Footer: Footer,
ModalUpload: Upload
}, {headerMode: 'none', transitionConfig: TransitionConfiguration})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With