Answers for "react make multiple fetch requests one after another"

1

react make multiple fetch requests one after another

/*
Fetch API requesting multiple get requests
*/

Promise.all([
  fetch("http://localhost:3000/items/get"),
  fetch("http://localhost:3000/contactlist/get"),
  fetch("http://localhost:3000/itemgroup/get")
]).then(([items, contactlist, itemgroup]) => {
    ReactDOM.render(
        <Test items={items} contactlist={contactlist} itemgroup={itemgroup} />,
        document.getElementById('overview');
    );
}).catch((err) => {
    console.log(err);
});
Posted by: Guest on January-12-2021

Code answers related to "react make multiple fetch requests one after another"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language