17 lines
426 B
TypeScript
17 lines
426 B
TypeScript
import * as ImagePicker from "expo-image-picker";
|
|
|
|
const uploadImage = async () => {
|
|
// No permissions request is necessary for launching the image library
|
|
let result = await ImagePicker.launchImageLibraryAsync({
|
|
mediaTypes: ImagePicker.MediaTypeOptions.All,
|
|
allowsEditing: true,
|
|
aspect: [4, 3],
|
|
quality: 1,
|
|
});
|
|
|
|
if (!result.canceled) {
|
|
return result.assets[0];
|
|
}
|
|
};
|
|
|
|
export default uploadImage;
|