Thunder_24
Thunder_24

Reputation: 25

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

enter image description here

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.

Upvotes: 0

Views: 81

Answers (1)

Amir Doreh
Amir Doreh

Reputation: 1439

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 !

Upvotes: 1

Related Questions