How to upload "many photos" and then fetch the photos in my react native app (as a list)?

78 Views Asked by At

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>
    );
  }
}
0

There are 0 best solutions below