hmm… maybe it is an issue with pulling the data from the file?
Would you mind giving that a try?
Here is a snippet from products.js:
export default [
{
id: "1",
image: "https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike1.png",
images: [
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike1.png",
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike1_1.png",
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike1_2.png",
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike1_3.png",
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike1_4.png",
],
name: "Wild Berry",
price: 160,
sizes: [39, 40, 41],
description: `Inspired by the original that debuted in 1985, the Air Jordan 1 Low delivers a clean, classic look that's familiar yet fresh. With an iconic design that blends seamlessly with any fit, these shoes are perfect for taking charge.
Advantages:
- Encapsulated Air-Sole unit for lightweight cushioning.
- Genuine leather on the upper for durability and a premium look.
- Solid rubber outsole for greater traction on different types of surfaces.
- Color Shown: Palomino/White/Wild Berry
- Model: 553558-215
- Proven efficacy
A timeless rubber sole combines with a soft sockliner and encapsulated Nike Air cushioning for all-day comfort. The rubber outsole offers durable traction on a variety of surfaces.`,
},
{
id: "2",
image: "https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike2.png",
images: [
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike2.png",
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike2_1.png",
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike2_2.png",
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike2_3.png",
"https://notjustdev-dummy.s3.us-east-2.amazonaws.com/nike/nike2_4.png",
],
name: "Air Force 1",
price: 169,
sizes: [39, 40, 41, 42, 43],
description: `Inspired by the original that debuted in 1985, the Air Jordan 1 Low delivers a clean, classic look that's familiar yet fresh. With an iconic design that blends seamlessly with any fit, these shoes are perfect for taking charge.
Advantages:
- Encapsulated Air-Sole unit for lightweight cushioning.
- Genuine leather on the upper for durability and a premium look.
- Solid rubber outsole for greater traction on different types of surfaces.
- Color Shown: Palomino/White/Wild Berry
- Model: 553558-215
- Proven efficacy
A timeless rubber sole combines with a soft sockliner and encapsulated Nike Air cushioning for all-day comfort. The rubber outsole offers durable traction on a variety of surfaces.`,
},
];
and here is the ProductsScreen:
import { StyleSheet, Text, View, Image, FlatList } from 'react-native';
import products from '../data/products';
const ProductsScreen = () => {
return (
<FlatList
data={products}
renderItem={({ item }) => (
<View style={styles.itemContainer}>
<Image source={{ uri: item.image}} style={styles.image} />
</View>
)}
numColumns={2}
/>
)
}
const styles = StyleSheet.create({
itemContainer: {
width: "50%",
padding: 1,
},
image: {
width: "100%",
aspectRatio: 1,
},
});
export default ProductsScreen;
and here is the app.js:
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, View} from 'react-native';
import Navigation from './src/components/navigation';
export default function App() {
return (
<View style={styles.container}>
<Navigation />
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});