最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Can't find Variable : "View" - Stack Overflow

programmeradmin3浏览0评论

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

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

Share Improve this question edited Apr 11, 2019 at 23:46 Rachel Gallen 28.6k22 gold badges75 silver badges86 bronze badges asked Apr 11, 2019 at 23:36 Camille BasbousCamille Basbous 3976 gold badges14 silver badges39 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

add view to the import like this:

import {StyleSheet,View} from "react-native" ;
发布评论

评论列表(0)

  1. 暂无评论