当我们按下上传图像按钮时,显示以下错误

Muh*_*eed 1 javascript frontend reactjs react-native expo

请检查错误,错误显示:图像选择器结果中的“已取消”键已被弃用。顺便说一句我用了取消

import React, { useEffect, useState } from 'react'
import { Alert, Button, Image, View, StyleSheet,Platform } from 'react-native'
import * as ImagePicker from 'expo-image-picker'
import Constants from 'expo-constants'


const Fine_Repair_Request = () => {
 const [image,setimage] = useState(null);

 useEffect( async() => {
  if(Platform.OS !== 'web'){
    const {status} =await ImagePicker.requestMediaLibraryPermissionsAsync();
    if(status !== 'granted'){
      alert('Permission denied')
    }
  }
 },[])
   
   const PickImage = async()=>{
    let result = await ImagePicker.launchImageLibraryAsync({
      mediaTypes: ImagePicker.MediaTypeOptions.All,
      allowsEditing:true,
      aspect:[4,3],
      quality:1
    })
    console.log(result)
    if(!result.canceled){
      setimage(result.uri)
    }
   }


  return (
    <View style={styles.container}>
      <Button title="Upload Image" onPress={PickImage} />
      {image && <Image source={{uri:image}}/>}
    </View>
  )
}
export default Fine_Repair_Request;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center'
  }
})
Run Code Online (Sandbox Code Playgroud)
 Error:  WARN  Key "cancelled" in the image picker result is deprecated and will be removed in SDK 48, use "canceled" instead
 WARN  Key "uri" in the image picker result is deprecated and will be removed in SDK 48, you can access selected assets through the "assets" array instead
Run Code Online (Sandbox Code Playgroud)

HIG*_*PES 5

删除 console.log 消除了我的错误消息。