Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native - The Component for route '...' must be a React component

Hello I'm trying to have a screens with a tab bar, but I can't proceed because an error is blocking me. I know I did follow some tutorial properly but in my case it didn't work.

Error: Screen_Shot

Target UI:

Tab Bar => Ordering (screen) => Category (screen)
           Settlement (screen)
           Pending (screen)

Code:

import Login from './src/component/screens/Login';
import tables from './src/component/screens/tables';
import Category from './src/component/screens/Category';
import Dishes from './src/component/screens/Dishes';
import Settlement from './src/component/screens/Settlement';
import Pending from './src/component/screens/Pending';
import SendingShit from './src/component/screens/SendingShit';

export default class App extends Component{
  render() {
    return (
      <Root />
    );
  }
}
const TabNav = createBottomTabNavigator (
  {
    uggh    : { screen: Kaartihan },       // The problem is here
    Settlement  : { screen: Settlement },
    Pending     : { screen: Pending },
  }
);
const Kaartihan = StackNavigator (
  {
    Ordering    : { screen: tables },
    Category    : { screen: Category },
  }
);
const Root = StackNavigator (
  {
    Login           : { screen: Login },
    Tabs            : { screen: TabNav },
    Dishes          : { screen: Dishes },
    SendingShit     : { screen: SendingShit }
  }
);
like image 819
Purple Violet Avatar asked Jan 28 '23 16:01

Purple Violet


1 Answers

Kaartihan is not initialized. Try to put Kaartihan before TabNav

like image 179
pryahin.v Avatar answered Jan 31 '23 08:01

pryahin.v