1

i can't display the image in my website, which is fetched from the API.

this is my image fetching/showing code.

this.state.filteredData.map((data,i) =>
                    <div>
                        <span>{data.details.name}</span>
                        <br/ >
                       <img source={{uri:data.details.image}} style={aStyle} />
                        <br/>
                        <span>{data.details[ 'section of law' ]}</span>
                        <br />3

                        <span>{data.details[ 'type of person' ]}</span>
                    </div>

const aStyle={
    width:300,
    height:360
};

enter image description here

only image box is showing.

L Y E S - C H I O U K H
  • 4,765
  • 8
  • 40
  • 57

2 Answers2

0
<img src={{uri:data.details.image}} style={aStyle} />
Yossi
  • 5,577
  • 7
  • 41
  • 76
0

image has src attribute and you can pass image url string or base64 image data to it.

<img src={data.details.image} style={aStyle} />
Vikramaditya
  • 5,444
  • 6
  • 34
  • 45