Click here to Skip to main content
15,880,651 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I map on the data and make to every object ul and li and image.
the src for the image from the data that comes from json and it is a key and value "src":"./icecream.jpg.
" in the object.
that what it look like : <img src={p.src}/>.. p here means the object, then inside that object the src and its value like './icecream.jpg'.


What I have tried:

{"name": "Ice Cream", "details": "Ice Cream",  "icart": "No",
 "id": 10, "count": 35, "price": 17, "itnum": 1, "src":"./icecream"},

    {props.pr.map(p=>(
        <ul className='ul-pr-shopping cont ' key={p.id}>
            <li><img src={p.src} alt="not found"/></li>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900