I am trying to figure out how to import the width, height, and style properties into a React component. To start, here is an example of a .json document with object properties:
"manufacturerData": {
"name": "Duesenberg",
"articleCount": 0,
"image": {
"file": "duesenberg.jpg",
"width": "140",
"height": "52",
"exists": true
}
},
My goal is to import the styles - width and height - into my image card container, which currently looks like this:
return (
<Card className='my-3 p-3 thumbnail' style={{ width: '14rem' }}>
<a href={`/articles/${articles.id}`}>
<Card.Img src={`/images/${articles.image.file}`} variat='top' />
</a>
</Card>
)
I have been struggling to find a straightforward solution online on how to achieve this. Any help would be greatly appreciated.