Chce stworzyć menu z kafelek ale mam problem z wyświetleniem grafiki. Pojawia mi się tekst title ale grafika już nie
const link = require('../assets/logo.png');
const product = [
{
title: 'pierwszy',
image: 'link'
},
{
title: 'drugi',
image: 'link'
},
{
title: 'trzeci',
image: 'link'
},
{
title: 'cztery',
image: 'link'
}
];
function ServiceHandler() {
() => navigation.navigate('Service')
}
function ServiceScreen() {
const navigation = useNavigation();
return (
<BackgroundImage>
<CustomHeader backButton={() => navigation.navigate('Home')} />
<View style={styles.rootContainer}>
<SafeAreaView >
<FlatList
numColumns={3}
data={product}
keyExtractor={(item, index) => index.toString()}
renderItem={({ item }) => (<Product product={item} />)}></FlatList>
</SafeAreaView>
</View>
</BackgroundImage>
);
}
I moja klasa produkty
import React from "react";
import { View, Text, Image} from "react-native";
class Product extends React.Component {
render(){
const {title, image} = this.props.product
return (
<View style={{width:'48%', alignItems: 'center', borderWidth: 0.75, marginHorizontal:'1%', borderColor: 'white'}}>
<Text>{title}</Text>
<Image source={{image}}/>
</View>
)
}
}
export default Product;