Design comparison
SolutionDesign
Solution retrospective
It's my first React App. I had a problem with image src path taken from JSON. I resolved this with converting data.json to js and importing all images but in the end, I don't know how to use image path. I try with require(image/path)
but it didn't work. I saw in other solution something like svgs.find
and spliting a path but it related with graphQL and Gatsby. Any feedback will be appreacited.
Community feedback
- @Sumukha210Posted about 4 years ago
<img src={yourimgpath ? yourimgpath : randomimg } alt="name" /> Try this, it may work
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord