I would like to know how to fetch multiple GET URLs at once and then put the fetched JSON data into my React DOM element.
Here is my code:
fetch("http://localhost:3000/items/get")
.then(function(response){
response.json().then(
function(data){
ReactDOM.render(
<Test items={data}/>,
document.getElementById('overview')
);}
);
})
.catch(function(err){console.log(err);});
However, I would like to fetch additional JSON datas from my server and then render my ReactDOM with all these JSON datas passed into it. For example:
ReactDOM.render(
<Test items={data} contactlist={data2} itemgroup={data3}/>,
document.getElementById('overview')
);
Is this possible? If not, what are other solutions to fetching multiple JSON data into my rendering ReactDOM element?