Currently, I am diving into learning React Native specifically for iOS development.
One issue that I am encountering is the inability to access information within an object, specifically a link to an image.
Inside the renderRow function for listView in React Native, my code looks like this:
renderRow(rowData, sectionID, rowID) {
console.log(rowData.media.imagenes[0].imagenLink)
When executed, it displays as shown below:
Picture of console.log(rowData.media)
Despite the expected functionality, writing the code in the following format results in an error:
console.log(rowData.media.imagenes[0].imagenLink)
Interestingly, when the code is placed outside of the renderRow() function, it works perfectly fine:
console.log(this.state.datosJSON[0].media.imagenes[0].imagenLink)
This allows me to successfully retrieve the link to the picture.
If anyone could provide assistance, it would be greatly appreciated. Thank you for your time and consideration.