问题
---------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:
回答1:
You are not importing Navigate
properly.
Use
import { Navigate } from './Navigate';
instead of
import Navigate from './Navigate';
来源:https://stackoverflow.com/questions/50576741/undefined-is-not-an-object-evaluating-rootcomponent-prototype