Reputation: 4182
I am importing an image component into my card which looks like that :
<CardWrapper as="a" href="#">
<CardImage src={props.data.imageUrl}/>
<CardMeta>
<CardLogo src={props.data.logoUrl} />
<CardText>{props.data.text}</CardText>
</CardMeta>
</CardWrapper>
The image component looks like :
export const Image = props => {
return (
<div>
{props.src}
<ImageContainer alt="test" src="{props.src}" />
</div>
)
}
Why is it printing this way? The path is correct? but the src still shows the brackets and not the correct path?
<div>
./Assets/Img/tile.jpg
<img alt="test" src="{props.src}" class="sc-bdVaJa bEXmsf">
</div>
Upvotes: 1
Views: 62
Reputation: 3498
It has to be in this way i guess
<ImageContainer alt="test" src={props.src} />
Upvotes: 3