Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined is not an object (evaluating 'RootComponent.prototype')

---------index.js--------

import { AppRegistry } from 'react-native';
import Navigate from './Navigate';

AppRegistry.registerComponent('form1', () => Navigate);

----Navigate.js-----

import React from 'react';
import { StackNavigator, DrawerNavigator } from 'react-navigation';
import TabsList from './TabsList';

export const StackTab1 = StackNavigator({
    TabList: { screen: TabsList},
});

export const Navigate =  DrawerNavigator(
    {
       Tab1: { screen : StackTab1 },
       Tab2: { screen : StackTab1 },
       Tab3: { screen : StackTab1 }
    });

Whenever I try to run my android simulator, I'm getting that error. All modules are installed, no errors being thrown within my IDE except for the one that's appearing in my simulator.

Picture below of error: enter image description here

like image 766
Sneha Chaudhari Avatar asked May 29 '18 05:05

Sneha Chaudhari


1 Answers

You are not importing Navigate properly.

Use

import { Navigate } from './Navigate';

instead of

import Navigate from './Navigate';
like image 102
akshay gore Avatar answered Oct 17 '22 11:10

akshay gore