📅  最后修改于: 2022-03-11 15:02:29.945000             🧑  作者: Mango
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