【发布时间】:2020-04-15 07:22:17
【问题描述】:
我正在运行如下代码 sn-p:
renderPropositions() {
const items = this.props.propositionAddress.map(async address => {
// get the instance of deployed contract
const instance = new web3.eth.Contract(JSON.parse(Proposition.interface), address);
const title = await instance.methods.pTitle().call();
return {
header: title,
meta: address
}
});
return <Card.Group items={items} />;
}
这不断地遇到上面的错误。但是当我删除 async 和 await 函数时,没有错误。
有人可以帮忙吗?
【问题讨论】:
标签: javascript reactjs next.js ethereum