D
D
d1zz72021-03-14 18:20:28
React
d1zz7, 2021-03-14 18:20:28

How to render multiple components in React using JSON?

Let's say we have JSON
const data = api_url.json();

And for example:

function BlaBla() {

return(
  
)
}


In render(), render several h1s here the value of name from JSON/h1 depending on the size of the JSON

Another example, this prints name` from JSON to the
console
: )
}

And I need to stuff it into the return( h1 {here name }/h1) method

, something like this))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
d1zz7, 2021-03-14
@d1zz7

Found a solution

A
Anvar Shakhmaev, 2021-03-14
@RxR

Learn React. Pay special attention to componentDidMount and useEffect. And also html, because rendering multiple h1 tags is bad manners.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question