我正在尝试做一个简单的聊天应用程序与React Native一起学习。这是App.js
//import the screens
import Chat from './components/Chat';
//import react navigation
import { createStackNavigator, createAppContainer } from 'react-navigation';
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
//create the navigator
const navigator = createStackNavigator({
Chat: { screen: Chat },
});
//export it as the root component
export default createAppContainer(navigator);我经常遇到null is not the object错误

在终端上,没有太多关于错误的信息:
Loading dependency graph, done.
DELTA [android, dev] ..\..\../index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (740/740), done.
::ffff:127.0.0.1 - - [01/Mar/2019:05:35:34 +0000] "GET /index.delta?platform=android&dev=true&minify=false HTTP/1.1" 200 - "-" "okhttp/3.12.1"
::ffff:127.0.0.1 - - [01/Mar/2019:05:35:37 +0000] "POST /symbolicate HTTP/1.1" 200 - "-" "okhttp/3.12.1"
::ffff:127.0.0.1 - - [01/Mar/2019:05:35:39 +0000] "POST /symbolicate HTTP/1.1" 200 - "-" "okhttp/3.12.1"看起来null被传入了路由交换机。是什么导致了这个错误?
发布于 2019-03-01 09:06:18
只能有一个export default,但可以有多个export,您可以导入多个导出,如下所示
import { export1, export2 } from "./componentName"https://stackoverflow.com/questions/54935928
复制相似问题