5
---------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

krlzlx
  • 5,752
  • 14
  • 47
  • 55

1 Answers1

6

You are not importing Navigate properly.

Use

import { Navigate } from './Navigate';

instead of

import Navigate from './Navigate';
akshay gore
  • 946
  • 8
  • 21
  • Thank You, Akshay but I always import files without curly brace and every time it works. – Sneha Chaudhari May 30 '18 at 04:56
  • Can you provide complete code? I will try to debug it. – akshay gore May 30 '18 at 08:38
  • Sometimes it's not Navigate but, `import App from './App';` instead of `import {App} from './App';` – Nay Jul 31 '18 at 21:36
  • @Nay That is likely to do with some things are _export_ _default_ which allows for you to import them alone like your example of App, but if _export_ is only used when the things imported in need to be specified curly braces specify those exported things. – Jacob Aug 19 '18 at 03:21