actually I want to make a list of photos in react native which the photos fetch from an API. I can fetch just "one" photo, but I can't fetch "many photos" as a list!
here is some part of my code:
export class CustomPhotoModal extends Component {
state= {jsonData:"...loading"};
componentDidMount(){
fetch("http://placekitten.com/200/300", {method:"GET"})
.then ((response)=> response.json())
.then ((json)=> {this.setState({
jsonData: json.title})
})
}
render() {
return (
<SafeAreaView style={{ flex: 1 }}>
<View style={styles.container}>
<FlatList
data={list}
renderItem={({ item }) => (
<View style={styles.ModalContainerView}>
<ImageModal
// source={item.photo}
/>
<View>
<Text>Designer: {item.name}</Text>
<Text>{item.describtion}</Text>
</View>
</View>
)}
/>
</View>
</SafeAreaView>
);
}
}