Home > Enterprise >  How I print a value from response (React Native)?
How I print a value from response (React Native)?

Time:04-27

How do I print the URI value from this response?

Response =  {"assets": [{"fileName": "rn_image_picker_lib_temp73410.jpg", "fileSize": 208402, "height": 1280, "type": "image/jpeg", "uri": "file:///data/user/0/com.react/cache/rn_image_picker_lib_temp73410.jpg", "width": 1028}]}

CodePudding user response:

You can achieve it doing like this:

    let Response = {
    "assets": [
        {
            "fileName": "rn_image_picker_lib_temp73410.jpg", 
            "fileSize": 208402, 
            "height": 1280, 
            "type": "image/jpeg", 
            "uri": "file:///data/user/0/com.react/cache/rn_image_picker_lib_temp73410.jpg", 
            "width": 1028
        }
    ]
}

Response.assets[0].uri
  • Related