Looks perfect, it should render the data without any problem, but still here is the full working example:
Working App: Expo Snack
import * as React from 'react';
import { Text, View, StyleSheet, Image } from 'react-native';
import Constants from 'expo-constants';
const donorsData = [
{
isDonor: true,
name: 'Nadi',
photo: 'https://i.stack.imgur.com/t8vJf.jpg?s=328&g=1',
uid: '2ZE',
email: '[email protected]',
},
{
email: '[email protected]',
isDonor: true,
name: 'Mz',
photo: 'https://i.stack.imgur.com/t8vJf.jpg?s=328&g=1',
uid: 'Cb',
},
];
export default function App() {
return (
<View style={styles.container}>
{donorsData.map((v, i) => {
return (
<View
key={v.uid}
style={{
backgroundColor: 'white',
padding: 10,
margin: 5,
borderRadius: 10,
}}>
<Text>{v.name}</Text>
<Text>{v.email}</Text>
<Image source={{ uri: v.photo }} style={{ height: 150, flex: 1 }} />
</View>
);
})}
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
padding: 8,
},
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…