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:
I needed the json format response so I added a little bit of code myself
Promise.all([ fetch(url1).then(value => value.json()), fetch(url2).then(value => value.json()) ]) .then((value) => { console.log(value) //json response }) .catch((err) => { console.log(err); });