请教下老师这是什么错误

来源:7-2 View:ui构建的基石,一切页面的起点

Panda_io

2023-05-14

请教下老师这是为何报错 : 是英文的图片描述

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

export default () => {

    return (
        <View style={styles.root}>
            <View style = {styles.subWView}/>
            <View style = {styles.subWView}/>
            <View style = {styles.subWView}/>
        <View/>
    );
}

const styles = StyleSheet.create({
    root: {
        flexDirection: 'column',
        height: '100%',
        backgroundColor: '#C0C0C0'
    },
    subWView: {
        width: 100,
        height: 100,
        backgroundColor: 'red'
    }
});
写回答

1回答

FE大公爵

2023-05-14

这是代码格式错误导致编译失败,肯定是忘写花括号,或者多写了一个符号啥的,你把完整代码发出来。
0
3
Panda_io
回复
FE大公爵
我上一秒也发现了,谢谢老师指正!
2023-05-14
共3条回复

RN从0到1系统精讲与小红书APP实战

30+小案例+2个实战项目,快人一步提升个职业竞争力

295 学习 · 211 问题

查看课程