问题
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