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,323
  • 8
  • 37
  • 53

2 Answers2

0
<img src={{uri:data.details.image}} style={aStyle} />
Yossi
  • 4,953
  • 6
  • 34
  • 69
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,086
  • 6
  • 31
  • 45