在本地本机expo.io中,undefined不是对象(评估“ g.ThemeColors.light”)

时间:2019-10-12 16:22:54

标签: react-native expo react-native-navigation

我正在学习react native并正在expo.io上工作,因为react native中的stackNavigation已更改,因此我在代码中进行了相应更改,但出现以下错误:

Device: (970:881) undefined is not an object (evaluating 'g.ThemeColors.light')
Evaluating module://react-navigation-stack.js
Evaluating module://App.js.js
Loading module://App.js

这是我的app.js代码,基本上是通过屏幕导航。

import * as React from 'react';
import {
  Text,
  TextInput,
  Button,
  View,
  StyleSheet,

} from 'react-native';
import { Constants } from 'expo';
import { createStackNavigator } from 'react-navigation-stack';
import { createAppContainer } from 'react-navigation';
// You can import from local files
import SignupView from './components/Screens/SignUpView';
import HomePage from './components/Screens/HomePage';
import SuperAdminHome from './components/Screens/SuperAdminHome';
import Departments from './components/Screens/Departments';

// or any pure javascript modules available in npm
import { Card } from 'react-native-paper';



const AppNavigator = createStackNavigator({

 //SplashView:{screen:Splash},
  HomePageScreen:{screen:HomePage},
  SignupScreen: { screen: SignupView },
  SuperAdminView:{screen:SuperAdminHome},
  DepartmentsView:{screen:Departments},

});

const AppContainer = createAppContainer(AppNavigator);

export default AppContainer;

1 个答案:

答案 0 :(得分:1)

您可以从博览会零食工作示例开始学习:

https://snack.expo.io/@mehran.khan/navigation