注意:我是 React Native 的新手,已经搜索了如何执行此操作,但没有找到有用的结果我正在使用 React Native 创建应用程序并想要添加多个组件,例如文本、按钮和文本输入空间,但是我无法在不收到错误的情况下执行此操作。有没有办法使用 React Native 将多个组件包含到一个 javascript 文档中?
我目前拥有的代码:
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class App extends React.Component {
render() {
return (
<View style={{alignItems: 'center'}}>
<Text style={styles.bigblack}>Sample Bold Text Here</Text>
<Text>Sample Text Here:</Text>
</View>
);
}
}
const styles = StyleSheet.create({
bigblack: {
color: 'black',
fontWeight: 'bold',
fontSize: 28,
},
red: {
color: 'red',
},
container: {
flex: 1,
backgroundColor: '#fdf5e6',
alignItems: 'center',
justifyContent: 'center', …Run Code Online (Sandbox Code Playgroud)