Reputation: 8375
I am following the code creating a CreateBottomTabNavigation with the use of react-native-elements to set up the icons.
const AppStack = createBottomTabNavigator(
{
QrCode: { screen: QrCodeScreen },
Profile: { screen: ProfileScreen }
},
{
navigationOptions: ({navigation}) => ({
tabBarIcon: ({focused, horizontal, tinitColor}) => {
const { routeName } = navigation.state;
let iconName;
if (routeName == 'QrCode') {
iconName = 'qrcode-scan';
} else if (routeName == 'Profile') {
iconName = 'face';
}
if (!focused)
return <Icon type='ionicon' name={iconName} color='#517fa4'/>
else
return <Icon type='ionicon' reverse name={iconName} color='#517fa4'/>
// You can return any component that you like here! We usually use an
// icon component from react-native-vector-icons
}
}),
tabBarOptions: {
activeTintColor: 'tomato',
inactiveBackgroundColor: 'gray'
}
});
Is it something wrong with the package..
Upvotes: 1
Views: 2276
Reputation: 2192
Simply import React in top of your file like
import React from 'react';
It should work.
Upvotes: 1