Home > front end >  How to get all photos on phone and show list of photos on a Flatlist in React Native
How to get all photos on phone and show list of photos on a Flatlist in React Native

Time:12-20

I wanted to find a library that could support getting all the photos from the phone and displaying the list of captured images on a Flatlist, and I ran this project on Expo. How to do this?

I tried using the library react-native-cameraroll but it seems when running on Expo it didn't work, is there any other way to handle this?

CodePudding user response:

you can use @react-native-camera-roll/camera-roll

npm i @react-native-camera-roll/camera-roll

use getPhotos method and it also supports pagination.

CameraRoll.getPhotos(params)

more details :- @react-native-camera-roll/camera-roll

CodePudding user response:

You can use expo-image-picker

npm i expo-image-picker

OR

yarn add expo-image-picker

Here is official Documentation Expo Image Picker

  • Related