0
THE ERROR MESSAGE I AM GETTING ON MY DEVICE Iam正在处理React Native.As我将其他反应本机文件(即component1.js)导入到index.android.js文件中。 它给出了一个错误 “预计组件类,得到[对象对象]”。在React本机中导入和导出文件
component1.js
import React, { Component } from 'react';
import {AppRegistry,Text,View} from 'react-native';
export default class component1 extends Component {
render() {
return(
<View>
<Text>This is component1</Text>
</View>
);
}
}
AppRegistry.registerComponent('component1',() => component1);
index.android.js
import React, { Component } from 'react';
import {AppRegistry,Text,View} from 'react-native';
import component1 from'./app/Components/component_a/component1'
export default class myapp extends Component {
render() {
return (
<View>
<component1 />
</View>
);
}
}
AppRegistry.registerComponent('myapp',() => myapp);