(0, _reactI18next.translate) is not a function - react-native

Actually I am new to react native and here I am trying to change language to Arabic using 'react-i18next' but when executed the following error ocures
ReactNativeJS ▶︎ (0, _reactI18next.translate) is not a function. (In
'(0, _reactI18next.translate)('common', {
bindI18n: 'languageChanged',
bindStore: false
})', '(0, _reactI18next.translate)' is undefined)
this is my code
import React from 'react';
import AppNavigator from './src/controller/AppNavigator';
import { translate } from 'react-i18next';
// import i18n from './src/I18n/index';
console.reportErrorsAsExceptions = false;
const WrappedStack = ({ t }) => {
return <AppNavigator screenProps={{ t }} />;
};
const ReloadAppOnLanguageChange = translate('common', {
bindI18n: 'languageChanged',
bindStore: false,
})(WrappedStack);
export default class App extends React.Component {
render() {
return (
<ReloadAppOnLanguageChange/>
);
}
}
AppNavigator.js
import {
createStackNavigator,
createAppContainer,
} from 'react-navigation';
import SScreen from '../view/sScreen/SScreen';
import Login from '../view/login/Login';
import SignUp from '../view/signUp/SignUp';
import TabNavigation from '../controller/TabNavigation';
import ForgotPassword from '../view/forgotPassword/ForgotPassword';
import AddAppointment from '../view/addAppointment/AddAppointment';
import DrProfile from '../view/drProfile/DrProfile';
import PaymentHistory from '../view/paymentHistory/PaymentHistory';
const AppNavigator = createStackNavigator({
SScreen: {
screen: SScreen,
navigationOptions: {
header: null
}
},
Login: {
screen: Login,
navigationOptions: {
header: null
}
},
SignUp: {
screen: SignUp,
navigationOptions: {
header: null
}
},
ForgotPassword: {
screen: ForgotPassword,
navigationOptions: {
header: null
}
},
TabNavigation: {
screen: TabNavigation,
navigationOptions: {
header: null,
title: "TabNavigation",
headerStyle: {
backgroundColor: '#B78FC3',
},
headerTintColor: 'white',
headerTitleStyle: {
fontWeight: 'bold',
},
headerTitleStyle: {
flex: 1,
textAlign: 'center',
},
headerLeft: null
},
},
AddAppointment: {
screen: AddAppointment,
navigationOptions: {
title: "Add An Appointment",
headerStyle: {
backgroundColor: '#B78FC3',
},
headerTintColor: 'white',
headerTitleStyle: {
fontWeight: 'bold',
},
headerTitleStyle: {
flex: 1,
textAlign: 'center',
},
},
},
DrProfile: {
screen: DrProfile,
navigationOptions: {
headerStyle: {
backgroundColor: '#B78FC3',
},
headerTintColor: 'white',
headerTitleStyle: {
fontWeight: 'bold',
},
headerTitleStyle: {
flex: 1,
textAlign: 'center',
},
},
},
PaymentHistory: {
screen: PaymentHistory,
navigationOptions: {
title: "Payment History",
headerStyle: {
backgroundColor: '#B78FC3',
},
headerTintColor: 'white',
headerTitleStyle: {
fontWeight: 'bold',
},
headerTitleStyle: {
flex: 1,
textAlign: 'center',
},
},
},
},
{ headerLayoutPreset: 'center' });
const App = createAppContainer(AppNavigator);
export default App;

Use withTranslation() instead of translate() HOC.
Seems like this one is missing in the migration docs.

Related

Swipe between screens isn't working in react-native, react navigation

I am trying to get my app to swipe between screens using react navigation. I have tried setting swipeEnabled, animationEnabled and gesturesEnabled to true but nothing has worked so far.
I am new to react navigation and thought i would give it a try.
I am using createStackNavigator so i dont know if i need to change that.
import React, { Component } from 'react';
import { createBottomTabNavigator,
createStackNavigator, createAppContainer } from 'react-navigation';
const Worcester = createStackNavigator(
{
Wrh,
},
{
initalRouteName: Wrh,
defaultNavigationOptions: {
title: 'Worcester',
headerLeft: <ActionBarImage />,
headerTintColor: '#333333',
headerTitleStyle: {
fontWeight: 'bold',
color: '#000000'
},
tabBarOptions: {
labelStyle: {
fontSize: 40
}
},
headerStyle: {
backgroundColor: '#FFFAFA',
borderBottomColor: '#ffffff',
borderBottomWidth: 3,
},
HeaderTitle: 'Test',
backgroundColor: '#FFDEAD',
swipeEnabled: true,
animationEnabled: true,
gesturesEnabled: true
}
});
const Alex = createStackNavigator(
{
Alx,
},
{
initalRouteName: Alx,
defaultNavigationOptions: {
title: 'Redditch',
headerLeft: <ActionBarImage />,
headerTintColor: '#333333',
headerTitleStyle: {
fontWeight: 'bold',
color: '#000000'
},
tabBarOptions: {
labelStyle: {
fontSize: 20
}
},
headerStyle: {
backgroundColor: '#FFFAFA',
borderBottomColor: '#ffffff',
borderBottomWidth: 3,
swipeEnabled: true,
animationEnabled: true,
gesturesEnabled: true
},
},
});
const TabNavigator = createBottomTabNavigator(
{
Worcester: { screen: Worcester },
Redditch: { screen: Alex },
},
{
tabBarOptions: {
activeTintColor: 'blue',
inactiveTintColor: '#605F60',
inactiveBackgroundColor: 'grey',
activeBackgroundColor: '#FFFAFA',
labelStyle: {
fontSize: 20,
marginTop: 0,
paddingTop: 0
},
style: {
paddingTop: 10
},
swipeEnabled: true,
animationEnabled: true,
gesturesEnabled: true
},
}
);
export default createAppContainer(TabNavigator);
You should use a topTabNavigator/bottomTabNavigator to swipe between screens on the same stack.
Then you use your stacknavigators,screens like that :
...
import { createMaterialTopTabNavigator, createStackNavigator } from 'react-navigation';
...
const someTabNavigator= createMaterialTopTabNavigator(
{
SomeScreen: {
screen:TheScreen,
navigationOptions: {
tabBarAccessibilityLabel: 'The Screen',
tabBarLabel: ({ tintColor }) => <LabelTitle tintColor={tintColor} label="The Screen" />,
},
},
SomeOtherScreen: {
screen: TheOtherScreen,
navigationOptions: {
tabBarAccessibilityLabel: 'The Other Screen',
tabBarLabel: ({ tintColor }) => <LabelTitle tintColor={tintColor} label="The Other Screen" />,
},
},
},
{
// Configs and etc.
swipeEnabled: true,
lazy: true,
optimizationsEnabled: true,
animationEnabled: true,
tabBarPosition: 'top',
tabBarOptions: {
scrollEnabled: true,
style: {
backgroundColor: colors.white,
},
inactiveTintColor: inactiveTintLabelColor,
activeTintColor: activeTintLabelColor,
indicatorStyle: {
backgroundColor: colors.primaryColor,
},
tabStyle: {
width: screen.screenWidth >= 600 ? 210 : 120,
}
},
}
)

How can i import the defaultNavigationOptions property on a screen?

I'm trying to import the react-navigation property into my screens the problem is that I always import the same defaultNavigationOptions for the different Stacks then to optimize the code I want to create as a kind of function so I only import it once on each screen without having to write it many times as I did, then my code so they understand more.
const BloquesStack = createStackNavigator(
{
BLOQUES: {
screen: ScreenBloquesRedux,
navigationOptions: ({ navigation }) => {
return {
headerLeft: <ButtonMenu navigation={navigation} />,
headerRight: <ButtonHome navigation={navigation} />
};
}
},
DetalleBloques: {
screen: DetalleBloque
},
IntegrantesBloque: {
screen: IntegrantesBloque
}
},
{
defaultNavigationOptions: {
headerBackTitle: "Atras",
headerTitleStyle: {
fontFamily: "RobotoCondensed-Regular",
fontWeight: "100",
fontSize: 20,
textAlign: "center",
color: white,
flex: 1
},
headerStyle: { backgroundColor: blue, height: 60 },
headerTintColor: white
}
}
);
export { BloquesStack };
const ComisionesStack = createStackNavigator(
{
COMISIONES: {
screen: ComisionesRedux,
navigationOptions: ({ navigation }) => {
return {
headerLeft: <ButtonMenu navigation={navigation} />,
headerRight: <ButtonHome navigation={navigation} />
};
}
}
},
{
defaultNavigationOptions: {
headerBackTitle: "Atras",
headerTitleStyle: {
fontFamily: "RobotoCondensed-Regular",
fontWeight: "100",
fontSize: 20,
textAlign: "center",
color: white,
flex: 1
},
headerStyle: { backgroundColor: blue, height: 60 },
headerTintColor: white
}
}
export { ComisionesStack };
const DrawerNavigator = createDrawerNavigator(
{
Diputados: { screen: DiputadosStack },
Bloques: { screen: BloquesStack },
Interbloques: { screen: InterBloquesStack },
Comisiones: { screen: ComisionesStack },
Autoridades: { screen: AutoridadesStack },
"Sesion En Vivo": { screen: SesionEnVivoStack },
"Diputados TV": { screen: DiputadosTVStack },
"Reglamentos HCDN": { screen: PDFReglamentosStack }
},
{
contentComponent: CustomDrawerContentComponent,
drawerWidth: width / 2,
contentOptions: {
activeTintColor: white,
activeBackgroundColor: Gris_Drawer,
inactiveTintColor: "rgb(105,105,104)",
itemsContainerStyle: {
textAlign: "center"
},
labelStyle: {
fontFamily: "RobotoCondensed-Regular",
fontWeight: "100",
fontSize: 17,
marginTop: 8,
marginLeft: 10
}
},
iconContainerStyle: {
opacity: 1
}
}
);
I just want to import default Navigation Options I do not intend to modify my navigation, I just want to know if it can be done. Thank you very much already
Create a separate object with the defaultNavigationOptions
const defaultNavigationOptions = {
headerBackTitle: "Atras",
headerTitleStyle: {
fontFamily: "RobotoCondensed-Regular",
fontWeight: "100",
fontSize: 20,
textAlign: "center",
color: white,
flex: 1
},
headerStyle: { backgroundColor: blue, height: 60 },
headerTintColor: white
}
const BloquesStack = createStackNavigator(
{ /* routes */ },
{ defaultNavigationOptions }
)
const ComisionesStack = createStackNavigator(
{ /* routes */ },
{ defaultNavigationOptions }
)

this.props.navigation.navigate does not work in screen

In my app I have a choose language screen which I have registered in the stackNavigator but I cannot use this.props.navigation.navigate in it
this 'choose language screen' appears on app first launch
this is index.js
import {AppRegistry} from 'react-native';
import App from './App';
import ChooseLanguage from './screens/ChooseLanguage'
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => ChooseLanguage);
this is ChooseLanguage Screen so when pressing the touchable opacity
I am calling this.props.navigation.navigate('AppIntroScreen') but it is not working it is giving me this error:
undefined is not an object (evaluating _this2.props.navigation.navigate)
import React, { Component } from "react";
import {
View,
Text,
StyleSheet,
Image, SafeAreaView, TouchableOpacity,AsyncStorage
} from "react-native";
import {withNavigation} from 'react-navigation'
import i18n from 'i18next';
import { translate } from 'react-i18next';
import NavigationService from './NavigationService';
import AppIntroScreen from './AppIntroScreen'
class ChooseLanguage extends Component {
state = {
isArabic: false,
isEnglish: false,
switchLang: true,
languageSet:false
}
async onChangeLang(lang) {
i18n.changeLanguage(lang);
try {
await AsyncStorage.setItem('#APP:languageCode', lang);
} catch (error) {
console.log(` Hi Errorrrr : ${error}`);
}
console.log(i18n.dir());
this.setState(state => ({
switchLang: !state.switchLang,
}));
}
render() {
const {t,navigation} = this.props;
console.log(navigation)
return (
(this.state.switchLang ? <SafeAreaView style={styles.container}>
<Image source={require('../assets/lang.png')} />
<Text style={{ fontSize: 25, color: '#FF5252', marginTop: 20, fontFamily: 'Hanken-Book' }}>Choose Language</Text>
<View style={{ flexDirection: 'row', justifyContent: 'space-evenly' }}>
<TouchableOpacity onPress={() => this.setState({ isEnglish: true, isArabic: false })} style={{ marginVertical: 20, marginHorizontal: 20, padding: 10, borderBottomColor: this.state.isEnglish ? '#a8a8a8' : '#ffffff', borderBottomWidth: this.state.isEnglish ? 1 : 0 }}>
<Text style={{color:this.state.isEnglish?'#000000':'#A8A8A8'}}>English</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.setState({ isEnglish: false, isArabic: true })} style={{ marginVertical: 20, marginHorizontal: 20, padding: 10,borderBottomColor: this.state.isArabic ? '#a8a8a8' : '#ffffff', borderBottomWidth: this.state.isArabic ? 1 : 0 }}>
<Text style={{color:this.state.isArabic?'#000000':'#A8A8A8'}}>Arabic</Text>
</TouchableOpacity>
</View>
<TouchableOpacity onPress={() =>
{
if(this.state.isArabic){
this.onChangeLang('ar');
this.props.navigation.navigate('AppIntroScreen');
}else if(this.state.isEnglish){
this.onChangeLang('en');
this.props.navigation.navigate('AppIntroScreen');
}else{
alert('Please Choose a language')
}
}
} style={{ backgroundColor: '#FF5252', alignSelf: 'center', padding: 10, width: '40%', marginTop: 15,borderRadius:5 }}>
<Text style={{ color: '#FFF', fontSize: 18, fontWeight: '100', textAlign: 'center', fontFamily: 'Hanken-Book' }}>Let's Start</Text>
</TouchableOpacity>
<View style={{
position: 'absolute',
bottom: 0,
right: 1,
left: 1,
height: 50,
justifyContent: 'center', alignItems: 'center'
}}>
<Image source={require('../assets/l1.png')} style={{ width: 120, height: 25 }} />
</View>
</SafeAreaView>:<AppIntroScreen />)
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
bottom: 20
}
});
export default translate(['chooselanguage'], { wait: true })(ChooseLanguage);
even though I am registering all my screens in the StackNavigator
here is the code of App.js
const TabNav = createBottomTabNavigator({
HomeScreen: {
screen: HomeScreen,
},
Categories: {
screen: Categories,
},
Search: {
screen: Search,
},
Settings: {
screen: Settings,
},
}, {
tabBarOptions: {
activeTintColor: '#ff5252',
inactiveTintColor: 'grey',
style: {
backgroundColor: 'white',
borderTopWidth: 0,
shadowOffset: { width: 5, height: 3 },
shadowColor: 'black',
shadowOpacity: 0.5,
elevation: 5
}
}
})
const StacksOverTabs = createStackNavigator({
Root: {
screen: TabNav,
},
ChooseLanguage:{
screen: ChooseLanguage,
navigationOptions:{
}
},
ListingPerCategory: {
screen: ListingPerCategory,
navigationOptions: {
// title: 'Notifications',
},
},
ListingInformation: {
screen: ListingInformation,
navigationOptions: {}
},
SubscribeScreen: {
screen: SubscribeScreen,
navigationOptions: {}
},
AppIntroScreen: {
screen: AppIntroScreen,
navigationOptions: {}
},
OnboardingScreens: {
screen: OnboardingScreens,
navigationOptions: {}
},
ListingDetail: {
screen: ListingDetail,
navigationOptions: {}
},
Contact: {
screen: ContactScreen,
navigationOptions: {}
},
}, {
headerMode: 'none',
navigationOptions: {
headerVisible: false,
}
});
const WrappedStack = ({ t,navigation }) => {
return <StacksOverTabs screenProps={{ t,navigation}} />;
};
const ReloadAppOnLanguageChange = translate('common', {
bindI18n: 'languageChanged',
bindStore: false,
})(WrappedStack);
class App extends React.Component {
state = { notification: {}, timePassed: false }
componentDidMount() {
OneSignal.init('99471d55-8e89-49ef-a70f-47661c9f952b', { kOSSettingsKeyAutoPrompt: true })
OneSignal.addEventListener('received', this.onReceived);
OneSignal.addEventListener('opened', this.onOpened);
OneSignal.addEventListener('ids', this.onIds);
}
async retrieveItem(key) {
try {
const retrievedItem = await AsyncStorage.getItem(key);
const item = JSON.parse(retrievedItem);
return item;
} catch (error) {
console.log("error");
}
return
}
componentWillUnmount() {
OneSignal.removeEventListener('received', this.onReceived);
OneSignal.removeEventListener('opened', this.onOpened);
OneSignal.removeEventListener('ids', this.onIds);
}
onReceived(notification) {
console.log("Notification received: ", notification);
}
onOpened(openResult) {
console.log('Message: ', openResult.notification.payload.body);
console.log('Data: ', openResult.notification.payload.additionalData);
console.log('isActive: ', openResult.notification.isAppInFocus);
console.log('openResult: ', openResult);
}
onIds(device) {
console.log('Device info: ', device);
}
render() {
this.retrieveItem('appLaunched').then((goals) => {
console.log(goals)
}).catch((error) => {
//this callback is executed when your Promise is rejected
console.log('Promise is rejected with error: ' + error);
});
return <ReloadAppOnLanguageChange />
}
}
export default App;
You can access the navigation prop in any component(deeply nested) by composing withNavigation HOC (not available in v1). It's useful when you cannot pass the navigation prop into the component directly, or don't want to pass it in case of a deeply nested child.
import React from 'react';
import { Button } from 'react-native';
import { withNavigation } from 'react-navigation';
class MyBackButton extends React.Component {
render() {
return <Button title="Back" onPress={() => { this.props.navigation.goBack() }} />;
}
}
// withNavigation returns a component that wraps MyBackButton and passes in the
// navigation prop
export default withNavigation(MyBackButton);

Header icon navigation not working on react navigation (React Native)

My React Native application consists of a TabNavigator that is nested inside of a StackNavigator, which is the entry point of the app's routing.
In the StackNavigator I have also a screen for About, which I want to be shown when an Icon in the header is clicked. The TabNavigator works as expected, however clicking the icon does nothing and does not produce any error. Does anyone have an idea what I am missing?
This is the code:
import { Icon } from 'native-base';
import React, { Component } from 'react';
import { createTabNavigator, createStackNavigator } from 'react-navigation';
import { View } from 'react-native';
import HomeTab from './tabs/HomeTab';
import HistoryTab from './tabs/HistoryTab';
import AboutScreen from './AboutScreen';
export default class Main extends Component {
static navigationOptions = ({ navigation }) => {
return {
headerTitle: 'Find Phone Country',
headerStyle: {
backgroundColor: '#C62828'
},
headerMode: 'screen',
headerTintColor: '#FFFFFF',
headerTitleStyle: {
fontWeight: 'bold',
justifyContent: 'space-between',
alignSelf: 'center',
textAlign: 'center',
flex: 1,
flexGrow: 1
},
headerRight: (
<Icon
name="ios-help-circle-outline"
style={{ paddingRight: 16, color: 'white' }}
onPress={() => navigation.navigate('About')}
/>
),
headerLeft: <View />
};
};
render() {
return <RootStack />;
}
}
const MainTabNavigator = createTabNavigator(
{
Home: {
screen: HomeTab
},
History: {
screen: HistoryTab
}
},
{
animationEnabled: true,
swipeEnabled: true,
tabBarPosition: 'bottom',
tabBarOptions: {
showIcon: true,
showLabel: true,
upperCaseLabel: false,
allowFontScaling: true,
indicatorStyle: {
opacity: 0
},
style: {
backgroundColor: '#C62828'
},
activeTintColor: '#ffffff',
inactiveTintColor: '#e0e0e0'
}
}
);
const RootStack = createStackNavigator({
Main: {
screen: MainTabNavigator,
navigationOptions: () => ({
title: 'Main',
headerBackTitle: null,
header: null
})
},
About: {
screen: AboutScreen,
navigationOptions: () => ({
title: 'About',
headerBackTitle: 'Back'
})
}
});
Thank you
Icon from native-base doesn't have a prop named onPress. Try encapsulating your icon inside a proper component for capturing the touch, like:
headerRight: (
<TouchableWithoutFeedback onPress={() => navigation.navigate('About')}>
<Icon
name="ios-help-circle-outline"
style={{ paddingRight: 16, color: 'white' }}
/>
</TouchableWithoutFeedback>
),
and don't forget, on your imports:
import { View, TouchableWithoutFeedback } from 'react-native';

React navigation How can I change the header navigation title dynamically for each tab?

I have created 3 screens which display as tabs on the createMaterialTopTabNavigator which is inside a stack navigator my issue is i dont know how to dynamically set Header title for each tab. currently setting the title to "welcome" applies to all the tabs. Any help please?
xxxxxx
xxxxxx
xxxxxx
xxxxxx
xxxxxx
import { LinearGradient } from 'expo';
import { Icon } from "native-base";
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { createMaterialTopTabNavigator, DrawerActions } from 'react-navigation';
import Home from '../TabNavigator/Home';
import MyProfile from '../TabNavigator/MyProfile';
import SelectAirtime from '../TabNavigator/SelectAirtime';
export default class TabNavigator extends React.Component {
static navigationOptions = ({ navigation, }) => {
return {
title: "Welcome",
headerLeft: (
<View style={{ padding: 10, }}>
<Icon style={{ color: '#fff', fontSize: 24 }} name='menu' type="MaterialCommunityIcons"
onPress={() => navigation.dispatch(DrawerActions.openDrawer())} />
</View>
),
headerBackground: (
<LinearGradient
colors={['#2acc55', '#10356c']}
style={{ flex: 1 }}
start={[0, 0]}
end={[1, 0]}
/>
),
headerTitleStyle: { color: '#fff' },
}
}
render() {
return (
<HomeScreenTabNavigator></HomeScreenTabNavigator>
);
}
}
const HomeScreenTabNavigator = createMaterialTopTabNavigator({
Home: {
screen: Home, navigationOptions: {
tabBarIcon: ({ tintColor }) => (<Icon style={{ color: 'white', fontSize: 24 }} name='home' type="MaterialCommunityIcons" />),
}
},
"Buy AirTime": {
screen: SelectAirtime, navigationOptions: {
tabBarIcon: ({ tintColor }) => (<Icon style={{ color: 'white', fontSize: 24 }} name='cards-outline' type="MaterialCommunityIcons" />),
}
},
"Account": {
screen: MyProfile, navigationOptions: {
tabBarIcon: ({ tintColor }) => (<Icon style={{ color: 'white', fontSize: 24 }} name='user' type="EvilIcons" />),
}
},
},
{
initialRouteName: 'Home',
tabBarPosition: 'bottom',
tabBarOptions: {
activeTintColor: 'white',
inactiveTintColor: '#f2f2f2',
labelStyle: {
fontSize: 9,
},
tabStyle: {
height: 60,
},
style: {
backgroundColor: '#1e3c72',
borderBottomColor: '#1e3c72',
},
indicatorStyle: {
height: 0,
},
showIcon: true,
}
}
)
Define TabNavigator:
import { LinearGradient } from 'expo';
import { Icon } from "native-base";
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { createMaterialTopTabNavigator, DrawerActions } from 'react-navigation';
import Home from '../TabNavigator/Home';
import MyProfile from '../TabNavigator/MyProfile';
import SelectAirtime from '../TabNavigator/SelectAirtime';
const HomeScreenTabNavigator = createMaterialTopTabNavigator({
Home: {
screen: Home,
navigationOptions: {
tabBarIcon: ({ tintColor, homeTitle }) => ( < Icon style = { { color: 'white', fontSize: 24 } } name = 'home'
type = "MaterialCommunityIcons" / > ),
tabBarLabel: homeTitle,
}
},
"Buy AirTime": {
screen: SelectAirtime,
navigationOptions: {
tabBarIcon: ({ tintColor, selectAirtimeTitle }) => ( < Icon style = { { color: 'white', fontSize: 24 } } name = 'cards-outline'
type = "MaterialCommunityIcons" / > ),
tabBarLabel: selectAirtimeTitle,
}
},
"Account": {
screen: MyProfile,
navigationOptions: {
tabBarIcon: ({ tintColor, myProfileTitle }) => ( < Icon style = { { color: 'white', fontSize: 24 } } name = 'user'
type = "EvilIcons" / > ),
tabBarLabel: myProfileTitle,
}
},
}, {
initialRouteName: 'Home',
tabBarPosition: 'bottom',
tabBarOptions: {
activeTintColor: 'white',
inactiveTintColor: '#f2f2f2',
labelStyle: {
fontSize: 9,
},
tabStyle: {
height: 60,
},
style: {
backgroundColor: '#1e3c72',
borderBottomColor: '#1e3c72',
},
indicatorStyle: {
height: 0,
},
showIcon: true,
}
})
export default HomeScreenTabNavigator;
use it:
<HomeScreenTabNavigator
screenProps={{
homeTitle: 'This home title',
selectAirtimeTitle: 'This airtime title',
myProfileTitle: 'This profile title',
}}
/>
I hope useful to you!