Can't find Variable : “View”

久未见 提交于 2019-12-13 03:31:53

问题


beginners question. The error says it can't find a variable: "View"

I have written this code in order to integrate a design to my code but it is giving: "can't find variable: View " what am I missing

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 

}});

I expect a blank screen with no errors


回答1:


add view to the import like this:

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


来源:https://stackoverflow.com/questions/55642567/cant-find-variable-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!