THE ERROR MESSAGE I AM GETTING ON MY DEVICE Ich arbeite auf React Native.As ich meine andere reagieren native Datei (d. Component1.js) in die Datei index.android.js importieren. Es gibt einen Fehler "Erwartete eine Komponente Klasse, bekam [Objekt Objekt]".Importieren und Exportieren von Datei in React native
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);