D
D
Dima2018-02-23 14:56:13
JavaScript
Dima, 2018-02-23 14:56:13

How to insert image path with JSON?

React.createElement('ul',null,text.map(function(prod){
            return <li>{prod.id}  {prod.image}  {prod.title}</li>;
          }

so displays the id path to the picture and the title
React.createElement('ul',null,text.map(function(prod){
            return <li>{prod.id}  <img src={prod.image}>  {prod.title}</li>;
          }

so scolding. swears at : after li, so some kind of trouble)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton fon Faust, 2018-02-23
Dolgoter @DDolgy

img needs to be created via React.createElement

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question