Problem rendering image with React Native api wordpress

0

asked by anonymous 02.04.2018 / 14:37

2 answers

0

You are using the variable as a string. Remove the quotation marks from the value of the object that you apply in the URI of the Image component.

Ex:

<Image source={{ uri: this.props.post.image }} />
    
16.04.2018 / 19:51
0

Your problem is that you are passing the value as string and not string template , which is the crase accent '.

<Image source={{uri: '${this.props.data.better_featured_image.media_details.sizes.thumbnail.source_url}'}}>

However, you do not need to use this format because you are passing a variable to uri. So just the path would be enough:

<Image source={{uri: this.props.data.better_featured_image.media_details.sizes.thumbnail.source_url}}>

I hope I have helped

    
23.04.2018 / 17:41