Answers for "async wait for axios reactjs"

0

async wait for axios reactjs

useEffect(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state
Posted by: Guest on July-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language