How do i fix a local path from Json to my React components rendering,
I searched for answer all over the internet, but NO luck :(
NOT WORKING :(
[
{
"name": "Apple",
"id": "001",
"price": "$995",
"imgUrl": "./Pictures/219.jpg"
}
]
WORKING, BUT TURTLE SPEED :/
[
{
"name": "Apple",
"id": "001",
"price": "$995",
"imgUrl": "http://www.placekitten.com/200/200"
}
]
import React from 'react' class Product extends React.Component { constructor(props) { super(props) }
render() {
return (
<div>
<img src={this.props.imgUrl}> />
<p>Name: {this.props.name}</p>
<p>Id: {this.props.id}</p>
<p>Price: {this.props.price}</p>
</div >
)
}
}