我已经完成了在互联网上搜索过的所有内容,但仍然会造成一些麻烦
来自Home.js的代码
import React from "react";
import { StyleSheet, Text, View } from "react-native";
export default class Home extends React.Component {
render() {
return (<View><text>hihihi</text></View>);
}
}
来自app.js的代码
import React from "react";
import Home from "./app/views/Home.js"
export default class App extends React.Component {
render() {
return (<Home />);
}
}
答案 0 :(得分:1)
更改
import React from "react";
import { StyleSheet, Text, View } from "react-native";
export default class Home extends React.Component {
render() {
return (<View><text>hihihi</text></View>);
}
}
到
import React from "react";
import { StyleSheet, Text, View } from "react-native";
export default class Home extends React.Component {
render() {
return (<View><Text>hihihi</Text></View>);
}
}
它是</Text>
而不是</text>
T是大写字母