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 badges1 Answer
Reset to default 7add view to the import like this:
import {StyleSheet,View} from "react-native" ;