Answer the question
In order to leave comments, you need to log in
How convenient is it to accept images from the backend and put them on the site?
I get the image path relative to src using api, insert it into img, but it doesn't work
<img src={item.image} alt={item.name} className="card-img-top" />
import Img from '../assets/player.jpg'
<img src={Img} alt={caseItem.title} />
Answer the question
In order to leave comments, you need to log in
You need to accept images from the back, use a convenient method, such as REST API / GraphQL, and then save somewhere on the client (state/localstorage etc.) , let's say in an array of objects.
And there, display the list, the standard map method:
<ul>
{list.map((item) => <li key={item.id}>{item.text}</li>)}
</ul>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question