React.createElement: тип недействителен - ожидается строка (для встроенных компонентов) или класс / функция (для составных компонентов), но получено:% s.% S% s, undefined, вероятно, вы забыли экспортировать компонент из файла, в котором он определен, или вы могли перепутать импорт по умолчанию и именованный импорт.
Проверьте свой код в приложении. js: 10., в приложении (созданном Expo Root) в RCTView (в NativeAppearance.tsx: 4) в FallbackAppearanceProvider (в src / index.tsx: 70) в AppearanceProvider (созданном Expo Root) в RootErrorBoundary (созданном Expo Root) в Expo Root ( в renderApplication. js: 45) в RCTView (в AppContainer. js: 109) в RCTView (в AppContainer. js: 135) в AppContainer (в renderApplication. js: 39)
код экспорта есть. В чем проблема в коде, пожалуйста?
Приложение js код
import { StatusBar } from "expo-status-bar";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { HotelComp } from "./components/hotel";
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<HotelComp />
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});
отель. js код
import React, { Component } from "react";
import { Text, View } from "react-native";
export class hotel extends Component {
render() {
return (
<View>
<Text> hotel Component </Text>
</View>
);
}
}
export default hotel;