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);