-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Closed
Labels
type: question or discussionIssue discussing or asking a question about GatsbyIssue discussing or asking a question about Gatsby
Description
Hi, I've got a question how can I send SVG images as props?
If I do this I can display the image without any problem.
import ihtml from '../images/html5.svg'
const Skill = () => (
<div>
<img src={ihtml} alt=""/>
</div>
)
But I can't display an image as a prop like this :
import ihtml from '../images/html5.svg'
const Skill = (props) => (
<div>
{
props.skillNames.map((skillName, index) => {
return (
<div key={shortid.generate()}>
// the value of skillName.icon is ihtml
<img src={skillName.icon} alt=""/>
</div>
)
})
}
</div>
)
Any idea of how can I display images as props?
Thanks
Metadata
Metadata
Assignees
Labels
type: question or discussionIssue discussing or asking a question about GatsbyIssue discussing or asking a question about Gatsby