0
我得到一个错误,当我尝试导入我的组件。 这是错误文本: “元素类型无效期望字符串(对于内置组件)或类/函数”。有错误,当我尝试导入我的组件在反应原生
主文件index.android.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import {Text2} from './components/Text2';
class p001_lesson extends Component {
render() {
return (
<View>
<Text2/>
</View>
);
}
}
AppRegistry.registerComponent('p001_lesson',() => p001_lesson);
second file Text2.js
<pre>
import React, {Component} from 'react';
import {
Text,
} from 'react-native';
class Text2 extends Component {
render() {
return <Text>some text here</Text>
}
}
如何解决我的进口?对不起,我的英语:D
我不写出口,ty –