【问题标题】:Can't find Variable : "View"找不到变量:“视图”
【发布时间】:2019-09-02 16:25:00
【问题描述】:

初学者问题。错误说找不到变量:“查看”

我编写此代码是为了将设计集成到我的代码中,但它给出:“找不到变量:查看”我错过了什么

import React from 'react';
import {StyleSheet} from "react-native" ;




export default class MenuButton extends React.Component {
    render() {
        return (
            <View menu={burger.menuIcon}>
            </View>
        )
    }
}

const burger = StyleSheet.create({
    menuIcon: {
color    : 'rgba(255,255,255,0.0)',
  top                 : 17 ,
  height              : 5 ,
  width               : 6 ,
  position            : 'absolute' ,
  margin              : 0,
  left                : 26 

}});

我希望一个没有错误的空白屏幕

【问题讨论】:

    标签: javascript html react-native frontend


    【解决方案1】:

    像这样向导入添加视图:

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

    【讨论】:

    • 它在我所有的其他文件中,除了这个我怎么错过了...谢谢你的回答
    • @CamilleBasbous 好伙伴。如果您认为这是正确答案,只需按答案底部的勾号使其变为绿色。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    • 1970-01-01
    • 1970-01-01
    • 2018-06-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多