简体   繁体   中英

React Native error when I run this code in phone

This is what I got when ran the code in my mobile phone using expo

在此处输入图像描述

This is the code for the app

    import React from 'react';
    import { Teext, StyleSheet } from 'react-native';`enter code here`

    const ComponentsScreen = () => {
    return <Text style={styles.textStyle}> Hello World! </Text>
    };
    const styles = StyleSheet.Create({
    textStyle: {
               fontsize: 30
          } 
    });
     export default ComponentsScreen;

This is the code that I ran and I don't know what the error is.

import { Teext, StyleSheet } from 'react-native';`enter code here`

it should be Text not Teext and you need to wrap it into a View Parent

const ComponentsScreen = () => {
    return(
<View>
 <Text style={styles.textStyle}> Hello World! </Text>
</View>
)
    };

do this and Welcome To React Native !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM