我已经使用react并学习了新概念(异步并等待),并且在项目中使用django作为后端,并使用Webpack和Babel作为前端进行了反应。
这是我组件中的方法
async loadProducts(){
const response = await fetch(this.endpoint, {
method: "GET",
headers: {
"Content-Type": "application/json"
}
});
return await response.json();
}
并引发一些错误(Uncaught ReferenceError: regeneratorRuntime is not defined
)