【问题标题】:React Native got this error when i ran my code in phone using expo当我使用 expo 在手机中运行代码时,React Native 出现此错误
【发布时间】:2020-05-21 03:21:01
【问题描述】:

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';

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

const styles = StyleSheet.Create({
    textStyle: {
       fontsize: 30
    } 
});

export default ComponentsScreen;

Here is the picture link

不知道这里的错误是什么,请帮助我。

【问题讨论】:

    标签: javascript reactjs react-native react-native-android expo


    【解决方案1】:

    StyleSheet.CreateC 改为小写,如:

    const styles = StyleSheet.create({
    

    会好的。

    【讨论】:

    猜你喜欢
    • 2022-11-12
    • 2021-09-12
    • 2022-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-13
    • 2018-06-27
    • 2021-08-09
    相关资源
    最近更新 更多