React Native在我使用expo在电话中运行代码时收到此错误

问题描述 投票:-2回答:1

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个回答
1
投票

StyleSheet.Create C更改为小写,如:

const styles = StyleSheet.create({

会没事的。

© www.soinside.com 2019 - 2024. All rights reserved.