[英]JSX expressions must have one parent element.ts(2657)
i am using React Native, i am freshman there , what is the problem here: mistake is there i am using React Native, i am freshman there , what is the problem here: mistake is there i am using React Native, i am freshman there , what is the problem here: mistake is there i am using React Native, i am freshman there , what is the problem here: mistake is there i am using React Native, i am freshman there , what is the problem here: mistake is there i am using React Native, i am freshman there , what is the problem here: mistake is there我正在使用 React Native,我是那里的新生,这里有什么问题:错误是我在使用 React Native,我是那里的新生,这里有什么问题:错误是我正在使用 React Native,我是那里的新生,这里有什么问题:错误是我使用 React Native,我是大一新生,这里有什么问题:错误是我使用 React Native,我是大一新生,这里有什么问题:有错误我正在使用 React Native,我是那里的大一新生,这里有什么问题:有错误
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
</View>
<View >
<Text>ffff</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'red',
},
});
You've to wrap up your content in a parent section or view like this:您必须将您的内容包含在父部分中或像这样查看:
import React from 'react';
import { StyleSheet, Text, View, StatusBar } from 'react-native';
export default function App() {
return (
<>
<StatusBar barStyle="dark-content"/>
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
</View>
<View >
<Text>ffff</Text>
</View>
</>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'red',
},
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.