【发布时间】:2021-08-25 15:46:36
【问题描述】:
const init = async()=>{
console.log("waiting for Fill1 method to complete");
const result1 = await contract.methods.Fill1("Mathematics", "77", "Physics", "80", "Chemistry", "30").send({from accounts[0]});
console.log("Fill1 completed);
console.log("Events from Fill1);
console.log(result1.events);
}
return (
<button onClick = {init} type "button">Display Information</button>
);
上面的代码将智能合约中的信息正确地呈现到控制台上,但我现在找不到使用 react 在 UI 中显示它的方法。我不知道我是否应该使用React.render() 或者是否有其他方式。我是 React 的新手,所以任何帮助都会很棒。谢谢!
【问题讨论】:
标签: html reactjs user-interface smartcontracts