-2

enter image description here

These createBottomTabNavigator icons not showing when i run in my device, but icons are showing when i run using web?

what i need add to show createBottomTabNavigator icons. can anyone suggest me. here this is App.js code from my project. i used

import * as React from 'react';
import 'react-native-gesture-handler'; 
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';


import Index from "./pages/Index";
import Home from "./pages/Home";
import LogIn from "./pages/LogIn";
import Register from "./pages/Register";
import CplusBooks from "./pages/CplusBooks";
import PhpBooks from "./pages/PhpBooks";
import DotNetBooks from "./pages/DotNetBooks";
import SearchBooks from "./pages/SearchBooks";

const Tab = createBottomTabNavigator();
const stack = createStackNavigator();

export default () => (
  <NavigationContainer>
    <stack.Navigator>

      <stack.Screen 
        name="Index" 
        component={Index} 
        options={{headerShown: false}} 
      />
      <stack.Screen 
        name="Home" 
        component={HomeTab} 
        options={{headerShown: false}}
      />
      <stack.Screen 
        name="LogIn" 
        component={LogIn} 
        options={{headerShown: false}}
      />
      <stack.Screen 
        name="Register" 
        component={Register} 
        options={{headerShown: false}}
      />
      <stack.Screen 
        name="CplusBooks" 
        component={CplusBooks}
        options={{headerShown: false}} 
      />
      <stack.Screen 
        name="PhpBooks" 
        component={PhpBooks}
        options={{headerShown: false}} 
      />
      <stack.Screen 
        name="DotNetBooks" 
        component={DotNetBooks}
        options={{headerShown: false}} 
      />
        
    </stack.Navigator>
  </NavigationContainer>
);
  • 1
    Please add relevant code and what version your using of react native navigation – Alpha Sep 15 '22 at 04:51
  • 1
    can you share code please? – Gaurav Roy Sep 15 '22 at 05:17
  • Any chance you could [edit] your question to share a [mcve] showing some code that reproduces the problem? From [ask]: *Help others reproduce the problem... if your problem is with code you've written, you should include some...Include just enough code to allow others to reproduce the problem.* – dbc Sep 17 '22 at 00:47

2 Answers2

0

It must be a problem with react-native-vector-icons Try this steps

Open android/app/build.gradle and add the following:

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

You can follow the instructions to properly install the module on Android: react-native-vector-icons#install-android

Bhavya Koshiya
  • 1,262
  • 2
  • 8
  • 22
0

First, make sure you're saving the dependency in your project by doing:

npm install react-native-vector-icons --save. Including the --save is necessary, otherwise react-native link won't be able to locate the module.