The Solidity Contract-Oriented Programming Language - By chatting here you agree to the https://github.com/ethereum/solidity/blob/develop/CODE_OF_CONDUCT.md
Hey! Has anyone used React for their project? I'm having a very simple issue which is annyoing me a bit...
I'm trying to set one of my states to web3.eth.getAccounts() at 0. But it refuses.
class UserProfile extends Component {
state = {
accountAddress: ''
};
async getAccounts() {
const accounts = await web3.eth.getAccounts();
this.setState({ accountAddress: accounts[0] });
console.log(accounts);
return {};
}
render() {
return (
<Layout>
<h3>UserProfile</h3>
<h5>{this.state.accountAddress}</h5>
</Layout>
);
};
};
export default UserProfile;
now
to something in that form