I already imported StyleSheet from react-native
but I got [ReferenceError can't find variable StyleSheet].
I don't know why. Please help me!
I read many stackoverflow posts, they forget to import StyleSheet, View, Text. But I didn't!!import React from 'react';
import { View, Text, StyleSheet, SafeAreaView } from 'react-native';
import { TouchableOpacity } from 'react-native-web';
const AddNewStamp = () => (
<View style={styles.container}>
<Header />
</View>
);
const Header = () => (
<SafeAreaView style = {styles.HeaderContainer}>
<TouchableOpacity>
<Image
source= {'./assets/icon/home_filled.png'}
style={{ width: 30, heigh: 30}}
/>
</TouchableOpacity>
<Text style={styles.HeaderText}>New Stamp</Text>
</SafeAreaView>
);
const styles = StyleSheet.create({
container: {
marginHorizontal: 10
},
HeaderContainer: {
flexDirection: 'row',
justifyContent: 'space-betwween',
alignItems: 'center',
},
HeaderText: {
color: '#fff',
fontWeight: '700',
fontSize: 20,
marginLeft: 25,
},
});
export default AddNewStamp;